Skip to content

Commit 1a8166b

Browse files
committed
[FIX] fix testcase, add DB type, delete double check(profile, import)
1 parent 2af963e commit 1a8166b

6 files changed

Lines changed: 14 additions & 9 deletions

File tree

backend/migrations/versions/001_initial_schema.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def downgrade() -> None:
9393
op.drop_table("profiles")
9494
op.drop_index("ix_users_email", "users")
9595
op.drop_table("users")
96-
# Drop enum types (PostgreSQL only; SQLite ignores)
97-
op.execute("DROP TYPE IF EXISTS accounttype")
98-
op.execute("DROP TYPE IF EXISTS userstatus")
96+
# Drop enum types (PostgreSQL only; SQLite has no user-defined types).
97+
if op.get_bind().dialect.name == "postgresql":
98+
op.execute("DROP TYPE IF EXISTS accounttype")
99+
op.execute("DROP TYPE IF EXISTS userstatus")

backend/migrations/versions/002_add_reports.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def downgrade() -> None:
7575
op.drop_index("ix_reports_reported_user_id", "reports")
7676
op.drop_index("ix_reports_reporter_user_id", "reports")
7777
op.drop_table("reports")
78-
# Drop enum types (PostgreSQL only; SQLite ignores)
79-
op.execute("DROP TYPE IF EXISTS reportreasoncode")
80-
op.execute("DROP TYPE IF EXISTS reportstatus")
78+
# Drop enum types (PostgreSQL only; SQLite has no user-defined types).
79+
if op.get_bind().dialect.name == "postgresql":
80+
op.execute("DROP TYPE IF EXISTS reportreasoncode")
81+
op.execute("DROP TYPE IF EXISTS reportstatus")

src/fall_in/core/game_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def bootstrap_authenticated_account(self, sync_local_progress: bool) -> dict:
278278

279279
from fall_in.net.backend_api import get_json, post_json
280280

281+
profile: dict = {}
281282
if self.has_registered_session() and sync_local_progress:
282283
merged = post_json(
283284
"/me/progress/merge",
@@ -300,7 +301,8 @@ def bootstrap_authenticated_account(self, sync_local_progress: bool) -> dict:
300301
],
301302
)
302303

303-
profile = get_json("/me/profile", self.access_token)
304+
if not profile:
305+
profile = get_json("/me/profile", self.access_token)
304306
self.user_id = profile.get("user_id")
305307
self.nickname = profile.get("nickname", self.nickname)
306308
self.account_type = profile.get("account_type", self.account_type)

src/fall_in/net/messages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ClientMessageType(str, Enum):
4242

4343
# Connection management
4444
PING = "PING"
45+
PONG = "PONG"
4546
RECONNECT = "RECONNECT"
4647

4748

src/fall_in/scenes/title_scene.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ def _open_debug_menu(self) -> None:
267267
if not DEBUG_MODE or GameManager().has_auth_session():
268268
return
269269

270-
from fall_in.core.game_manager import GameManager
271270
from fall_in.scenes.title_debug_scene import DebugScene
272271

273272
GameManager().change_scene(DebugScene())

tests/multiplayer/test_game_scene_multiplayer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,11 @@ def test_remote_match_result_transitions_to_game_over_scene(monkeypatch):
303303
import fall_in.scenes.game_over_scene as game_over_module
304304

305305
class _FakeGameOverScene:
306-
def __init__(self, winner, players, round_number):
306+
def __init__(self, winner, players, round_number, multiplayer_reward=None):
307307
self.winner = winner
308308
self.players = players
309309
self.round_number = round_number
310+
self.multiplayer_reward = multiplayer_reward
310311

311312
monkeypatch.setattr(game_over_module, "GameOverScene", _FakeGameOverScene)
312313
monkeypatch.setattr(

0 commit comments

Comments
 (0)