Compare commits

...

6 Commits

Author SHA1 Message Date
CI
9aec57166d chore: release version v1.29.5
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (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 / 🏷 Create Release (push) Has been cancelled
2024-12-14 22:32:16 +00:00
Dmitry Popov
a3739f2950 Merge branch 'main' of github.com:wanderer-industries/wanderer 2024-12-14 23:31:47 +01:00
Dmitry Popov
3d3b152758 fix(Core): Fix character trackers cleanup 2024-12-14 23:31:42 +01:00
CI
0e03730543 chore: release version v1.29.4
Some checks failed
Build / 🚀 Deploy to test env (fly.io) (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 / 🏷 Create Release (push) Has been cancelled
2024-12-10 11:01:09 +00:00
Dmitry Popov
97e07a6511 Merge branch 'main' of github.com:wanderer-industries/wanderer 2024-12-10 12:00:38 +01:00
Dmitry Popov
a77a51ba15 fix(Core): Small fixes 2024-12-10 12:00:34 +01:00
9 changed files with 60 additions and 14 deletions

View File

@@ -2,6 +2,24 @@
<!-- changelog -->
## [v1.29.5](https://github.com/wanderer-industries/wanderer/compare/v1.29.4...v1.29.5) (2024-12-14)
### Bug Fixes:
* Core: Fix character trackers cleanup
## [v1.29.4](https://github.com/wanderer-industries/wanderer/compare/v1.29.3...v1.29.4) (2024-12-10)
### Bug Fixes:
* Core: Small fixes
## [v1.29.3](https://github.com/wanderer-industries/wanderer/compare/v1.29.2...v1.29.3) (2024-12-07)

View File

@@ -12,11 +12,16 @@ defmodule WandererApp.Api.MapCharacterSettings do
code_interface do
define(:create, action: :create)
define(:destroy, action: :destroy)
define(:read_by_map,
action: :read_by_map
)
define(:by_map_filtered,
action: :by_map_filtered
)
define(:tracked_by_map_filtered,
action: :tracked_by_map_filtered
)
@@ -38,6 +43,13 @@ defmodule WandererApp.Api.MapCharacterSettings do
defaults [:create, :read, :update, :destroy]
read :by_map_filtered do
argument(:map_id, :string, allow_nil?: false)
argument(:character_ids, {:array, :uuid}, allow_nil?: false)
filter(expr(map_id == ^arg(:map_id) and character_id in ^arg(:character_ids)))
end
read :tracked_by_map_filtered do
argument(:map_id, :string, allow_nil?: false)
argument(:character_ids, {:array, :uuid}, allow_nil?: false)

View File

@@ -446,8 +446,13 @@ defmodule WandererApp.Character.Tracker do
|> Map.merge(%{alliance_id: alliance_id, corporation_id: corporation_id})
|> maybe_update_alliance()
_error ->
Logger.warning("Failed to get corporation info for #{corporation_id}")
error ->
Logger.warning(
"Failed to get corporation info for character #{character_id}: #{inspect(error)}",
character_id: character_id,
corporation_id: corporation_id
)
state
end
end

View File

@@ -191,7 +191,7 @@ defmodule WandererApp.Map do
case characters |> Enum.member?(character_id) do
true ->
map_id
|> update_map(%{characters: Enum.reject(characters, fn id -> id == character_id end)})
|> update_map(%{characters: characters |> Enum.reject(fn id -> id == character_id end)})
:ok

View File

@@ -89,6 +89,11 @@ defmodule WandererApp.Map.Server.CharactersImpl do
[]
)
acls =
map_id
|> WandererApp.Map.get_map!()
|> Map.get(:acls, [])
invalidate_character_ids
|> Task.async_stream(
fn character_id ->
@@ -96,11 +101,6 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|> WandererApp.Character.get_character()
|> case do
{:ok, character} ->
acls =
map_id
|> WandererApp.Map.get_map!()
|> Map.get(:acls, [])
[character_permissions] =
WandererApp.Permissions.check_characters_access([character], acls)
@@ -157,12 +157,12 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|> untrack_characters(character_ids)
map_id
|> WandererApp.MapCharacterSettingsRepo.get_tracked_by_map_filtered(character_ids)
|> WandererApp.MapCharacterSettingsRepo.get_by_map_filtered(character_ids)
|> case do
{:ok, settings} ->
settings
|> Enum.each(fn s ->
WandererApp.MapCharacterSettingsRepo.untrack(s)
WandererApp.MapCharacterSettingsRepo.destroy!(s)
remove_character(map_id, s.character_id)
end)

View File

@@ -486,7 +486,7 @@ defmodule WandererApp.Map.Server.SystemsImpl do
state
else
error ->
Logger.error("Fail ed to update system: #{inspect(error, pretty: true)}")
Logger.error("Failed to update system: #{inspect(error, pretty: true)}")
state
end
end

View File

@@ -11,6 +11,13 @@ defmodule WandererApp.MapCharacterSettingsRepo do
character_ids: character_ids
})
def get_by_map_filtered(map_id, character_ids),
do:
WandererApp.Api.MapCharacterSettings.by_map_filtered(%{
map_id: map_id,
character_ids: character_ids
})
def get_all_by_map(map_id),
do: WandererApp.Api.MapCharacterSettings.read_by_map(%{map_id: map_id})
@@ -22,4 +29,6 @@ defmodule WandererApp.MapCharacterSettingsRepo do
def track!(settings), do: settings |> WandererApp.Api.MapCharacterSettings.track!()
def untrack!(settings), do: settings |> WandererApp.Api.MapCharacterSettings.untrack!()
def destroy!(settings), do: settings |> WandererApp.Api.MapCharacterSettings.destroy!()
end

View File

@@ -197,11 +197,13 @@ defmodule WandererAppWeb.MapsLive do
{:noreply, socket}
end
def handle_event("validate", %{"form" => params} = _params, socket) do
def handle_event("validate", %{"form" => form} = _params, socket) do
form =
AshPhoenix.Form.validate(
socket.assigns.form,
params |> Map.put("acls", params["acls"] || [])
form
|> Map.put("acls", form["acls"] || [])
|> Map.put("only_tracked_characters", form["only_tracked_characters"] || false)
)
{:noreply, socket |> assign(form: form)}

View File

@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
use Mix.Project
@source_url "https://github.com/wanderer-industries/wanderer"
@version "1.29.3"
@version "1.29.5"
def project do
[