Compare commits

...

9 Commits

Author SHA1 Message Date
CI
6d99c54af7 chore: release version v1.62.3
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (push) Has been cancelled
Build / Manual Approval (push) Has been cancelled
Build / 🛠 Build (1.17, 18.x, 27) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/amd64) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/arm64) (push) Has been cancelled
Build / merge (push) Has been cancelled
Build / 🏷 Create Release (push) Has been cancelled
2025-05-08 12:14:20 +00:00
Dmitry Popov
2b7901e9a8 Merge branch 'main' of github.com:wanderer-industries/wanderer 2025-05-08 12:20:14 +02:00
Dmitry Popov
fb06dd1dbc fix(Core): Fixed map characters got untracked 2025-05-08 12:20:09 +02:00
CI
f8ba36b8be chore: release version v1.62.2
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (push) Has been cancelled
Build / Manual Approval (push) Has been cancelled
Build / 🛠 Build (1.17, 18.x, 27) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/amd64) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/arm64) (push) Has been cancelled
Build / merge (push) Has been cancelled
Build / 🏷 Create Release (push) Has been cancelled
2025-05-05 18:51:41 +00:00
Dmitry Popov
5bf9d99b3d Merge branch 'main' of github.com:wanderer-industries/wanderer 2025-05-05 20:32:17 +02:00
Dmitry Popov
7cad05342a fix(Core): Fixed audit export API 2025-05-05 20:32:14 +02:00
CI
867780e525 chore: release version v1.62.1
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (push) Has been cancelled
Build / Manual Approval (push) Has been cancelled
Build / 🛠 Build (1.17, 18.x, 27) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/amd64) (push) Has been cancelled
Build / 🛠 Build Docker Images (linux/arm64) (push) Has been cancelled
Build / merge (push) Has been cancelled
Build / 🏷 Create Release (push) Has been cancelled
2025-05-05 09:14:15 +00:00
Dmitry Popov
ff4f9a79c9 Merge branch 'main' of github.com:wanderer-industries/wanderer 2025-05-05 10:18:44 +02:00
Dmitry Popov
6699c36fb3 chore: load user roads for map with active subscription only 2025-05-05 10:18:41 +02:00
10 changed files with 102 additions and 56 deletions

View File

@@ -2,6 +2,29 @@
<!-- changelog -->
## [v1.62.3](https://github.com/wanderer-industries/wanderer/compare/v1.62.2...v1.62.3) (2025-05-08)
### Bug Fixes:
* Core: Fixed map characters got untracked
## [v1.62.2](https://github.com/wanderer-industries/wanderer/compare/v1.62.1...v1.62.2) (2025-05-05)
### Bug Fixes:
* Core: Fixed audit export API
## [v1.62.1](https://github.com/wanderer-industries/wanderer/compare/v1.62.0...v1.62.1) (2025-05-05)
## [v1.62.0](https://github.com/wanderer-industries/wanderer/compare/v1.61.2...v1.62.0) (2025-05-05)

View File

@@ -33,7 +33,7 @@ defmodule WandererApp.Character.Tracker do
status: binary()
}
@online_error_timeout :timer.minutes(2)
@online_error_timeout :timer.minutes(5)
@forbidden_ttl :timer.minutes(1)
@pubsub_client Application.compile_env(:wanderer_app, :pubsub_client)
@@ -49,7 +49,7 @@ defmodule WandererApp.Character.Tracker do
|> new()
end
def update_track_settings(character_id, track_settings) do
def update_settings(character_id, track_settings) do
{:ok, character_state} = WandererApp.Character.get_character_state(character_id)
{:ok,
@@ -494,7 +494,7 @@ defmodule WandererApp.Character.Tracker do
state,
location
) do
location = get_location(location)
location = get_location(location)
if not is_location_started?(character_id) do
WandererApp.Cache.lookup!("character:#{character_id}:start_solar_system_id", nil)
@@ -544,14 +544,18 @@ defmodule WandererApp.Character.Tracker do
)
defp is_location_updated?(
%{solar_system_id: new_solar_system_id, station_id: new_station_id, structure_id: new_structure_id} = _location,
%{
solar_system_id: new_solar_system_id,
station_id: new_station_id,
structure_id: new_structure_id
} = _location,
solar_system_id,
structure_id,
station_id
),
do:
solar_system_id != new_solar_system_id ||
solar_system_id != new_solar_system_id ||
solar_system_id != new_solar_system_id ||
structure_id != new_structure_id ||
station_id != new_station_id
@@ -724,14 +728,7 @@ defmodule WandererApp.Character.Tracker do
)
end
WandererApp.Character.update_character(character_id, %{online: false})
%{
state
| track_ship: false,
track_online: false,
track_location: false
}
state
end
defp maybe_stop_tracking(
@@ -759,5 +756,5 @@ defmodule WandererApp.Character.Tracker do
defp get_online(%{"online" => online}), do: %{online: online}
defp get_online(_), do: %{online: false}
defp get_online(_), do: %{online: true}
end

View File

@@ -118,7 +118,7 @@ defmodule WandererApp.Character.TrackerManager.Impl do
)
{:ok, character_state} =
WandererApp.Character.Tracker.update_track_settings(character_id, track_settings)
WandererApp.Character.Tracker.update_settings(character_id, track_settings)
WandererApp.Character.update_character_state(character_id, character_state)
else
@@ -213,15 +213,17 @@ defmodule WandererApp.Character.TrackerManager.Impl do
WandererApp.Cache.get_and_remove!("character_untrack_queue", [])
|> Task.async_stream(
fn {map_id, character_id} ->
WandererApp.Cache.delete("map_#{map_id}:character_#{character_id}:tracked")
if not character_is_present(map_id, character_id) do
WandererApp.Cache.delete("map_#{map_id}:character_#{character_id}:tracked")
{:ok, character_state} =
WandererApp.Character.Tracker.update_track_settings(character_id, %{
map_id: map_id,
track: false
})
{:ok, character_state} =
WandererApp.Character.Tracker.update_settings(character_id, %{
map_id: map_id,
track: false
})
WandererApp.Character.update_character_state(character_id, character_state)
WandererApp.Character.update_character_state(character_id, character_state)
end
end,
max_concurrency: System.schedulers_online(),
on_timeout: :kill_task,
@@ -250,4 +252,11 @@ defmodule WandererApp.Character.TrackerManager.Impl do
def handle_info(_event, state),
do: state
defp character_is_present(map_id, character_id) do
{:ok, presence_character_ids} =
WandererApp.Cache.lookup("map_#{map_id}:presence_character_ids", [])
Enum.member?(presence_character_ids, character_id)
end
end

View File

@@ -120,7 +120,7 @@ defmodule WandererApp.Character.TrackingUtils do
{:ok, updated_settings} =
WandererApp.MapCharacterSettingsRepo.untrack(existing_settings)
:ok = untrack_characters([character], map_id, caller_pid)
:ok = untrack([character], map_id, caller_pid)
:ok = remove_characters([character], map_id)
{:ok, updated_settings}
else
@@ -131,7 +131,7 @@ defmodule WandererApp.Character.TrackingUtils do
{:ok, %{tracked: false} = existing_settings} ->
if track do
{:ok, updated_settings} = WandererApp.MapCharacterSettingsRepo.track(existing_settings)
:ok = track_characters([character], map_id, true, caller_pid)
:ok = track([character], map_id, true, caller_pid)
:ok = add_characters([character], map_id, true)
{:ok, updated_settings}
else
@@ -148,7 +148,7 @@ defmodule WandererApp.Character.TrackingUtils do
tracked: true
})
:ok = track_characters([character], map_id, true, caller_pid)
:ok = track([character], map_id, true, caller_pid)
:ok = add_characters([character], map_id, true)
{:ok, settings}
else
@@ -161,25 +161,25 @@ defmodule WandererApp.Character.TrackingUtils do
end
# Helper functions for character tracking
def track_characters(_, _, false, _), do: :ok
def track_characters([], _map_id, _is_track_character?, _), do: :ok
def track(_, _, false, _), do: :ok
def track([], _map_id, _is_track_character?, _), do: :ok
def track_characters([character | characters], map_id, true, caller_pid) do
def track([character | characters], map_id, true, caller_pid) do
with :ok <- track_character(character, map_id, caller_pid) do
track_characters(characters, map_id, true, caller_pid)
track(characters, map_id, true, caller_pid)
end
end
def track_character(
%{
id: character_id,
eve_id: eve_id,
corporation_id: corporation_id,
alliance_id: alliance_id
},
map_id,
caller_pid
) do
defp track_character(
%{
id: character_id,
eve_id: eve_id,
corporation_id: corporation_id,
alliance_id: alliance_id
},
map_id,
caller_pid
) do
with false <- is_nil(caller_pid) do
WandererAppWeb.Presence.track(caller_pid, map_id, character_id, %{})
@@ -202,7 +202,7 @@ defmodule WandererApp.Character.TrackingUtils do
end
end
def untrack_characters(characters, map_id, caller_pid) do
def untrack(characters, map_id, caller_pid) do
with false <- is_nil(caller_pid) do
characters
|> Enum.each(fn character ->

View File

@@ -32,7 +32,7 @@ defmodule WandererApp.Esi.ApiClient do
}
@cache_opts [cache: true]
@retry_opts [max_retries: 1, retry_log_level: :warning]
@retry_opts [max_retries: 0, retry_log_level: :warning]
@timeout_opts [pool_timeout: 15_000, receive_timeout: :timer.seconds(30)]
@api_retry_count 1
@@ -490,7 +490,11 @@ defmodule WandererApp.Esi.ApiClient do
try do
case Req.get(
"#{@base_url}#{path}",
api_opts |> with_user_agent_opts() |> with_cache_opts() |> Keyword.merge(@retry_opts) |> Keyword.merge(@timeout_opts)
api_opts
|> with_user_agent_opts()
|> with_cache_opts()
|> Keyword.merge(@retry_opts)
|> Keyword.merge(@timeout_opts)
) do
{:ok, %{status: 200, body: body}} ->
{:ok, body}

View File

@@ -335,7 +335,7 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
defp handle_tracking_event({:track_characters, map_characters, track_character}, socket, map_id) do
:ok =
WandererApp.Character.TrackingUtils.track_characters(
WandererApp.Character.TrackingUtils.track(
map_characters,
map_id,
track_character,

View File

@@ -57,7 +57,7 @@ defmodule WandererAppWeb.MapCoreEventHandler do
case track_character do
false ->
:ok =
WandererApp.Character.TrackingUtils.untrack_characters(
WandererApp.Character.TrackingUtils.untrack(
map_characters,
map_id,
self()
@@ -67,7 +67,7 @@ defmodule WandererAppWeb.MapCoreEventHandler do
_ ->
:ok =
WandererApp.Character.TrackingUtils.track_characters(
WandererApp.Character.TrackingUtils.track(
map_characters,
map_id,
true,

View File

@@ -71,20 +71,31 @@ defmodule WandererAppWeb.MapRoutesEventHandler do
def handle_ui_event(
"get_user_routes",
%{"system_id" => solar_system_id, "routes_settings" => routes_settings} = _event,
%{assigns: %{map_id: map_id, map_loaded?: true, current_user: current_user}} = socket
%{
assigns: %{
map_id: map_id,
map_loaded?: true,
current_user: current_user,
is_subscription_active?: is_subscription_active?
}
} = socket
) do
Task.async(fn ->
{:ok, hubs} = WandererApp.MapUserSettingsRepo.get_hubs(map_id, current_user.id)
if is_subscription_active? do
{:ok, hubs} = WandererApp.MapUserSettingsRepo.get_hubs(map_id, current_user.id)
{:ok, routes} =
WandererApp.Maps.find_routes(
map_id,
hubs,
solar_system_id,
get_routes_settings(routes_settings)
)
{:ok, routes} =
WandererApp.Maps.find_routes(
map_id,
hubs,
solar_system_id,
get_routes_settings(routes_settings)
)
{:user_routes, {solar_system_id, routes}}
{:user_routes, {solar_system_id, routes}}
else
{:user_routes, {solar_system_id, %{routes: [], systems_static_data: []}}}
end
end)
{:noreply, socket}

View File

@@ -291,6 +291,8 @@ defmodule WandererAppWeb.MapEventHandler do
def push_map_event(socket, _type, _body), do: socket
def map_ui_character_stat(nil), do: nil
def map_ui_character_stat(character),
do:
character

View File

@@ -3,7 +3,7 @@ defmodule WandererApp.MixProject do
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.62.0"
@version "1.62.3"
def project do
[