Commit Graph

9008 Commits

Author SHA1 Message Date
Georges-Antoine Assi
2f695dd4d0 mini fix 2026-03-23 16:43:24 -04:00
Georges-Antoine Assi
3ffb11fb84 fix tests 2026-03-22 17:43:16 -04:00
Georges-Antoine Assi
f107dc2752 changes from bot rview 2026-03-22 17:17:14 -04:00
Georges-Antoine Assi
4c97eddfc3 fix trunk check 2026-03-22 16:30:14 -04:00
Georges-Antoine Assi
7f7f7eb752 fix down migration 2026-03-21 21:25:20 -04:00
Georges-Antoine Assi
22e273f0f5 add sync to task type item 2026-03-16 08:54:40 -04:00
Georges-Antoine Assi
318d5c8cd6 Merge pull request #3135 from tmgast/save-sync-cleanup
fix: address bugs and add test coverage for save-sync
2026-03-16 08:51:19 -04:00
nendo
933dcf0443 fix: reuse enum variable in create_table to prevent duplicate type on PostgreSQL
The sa.Enum() inline in create_table tried to CREATE TYPE again after
the explicit ENUM.create() call. Use the pre-created enum variable
with create_type=False for PostgreSQL to avoid DuplicateObject error.

Verified locally: upgrade, downgrade, re-upgrade all clean on PostgreSQL.
2026-03-16 11:55:12 +09:00
nendo
269d492e62 fix: use checkfirst=True for PostgreSQL enum creation in migration
The syncsessionstatus enum creation used checkfirst=False which fails
with DuplicateObject if the type already exists (e.g., test reruns or
partial migrations). Matches the pattern used in the downgrade.
2026-03-16 11:49:05 +09:00
nendo
51c990dcba fix(ci): install mariadb connectors on all runners
uv sync installs sqlalchemy[mariadb-connector] regardless of which
database is being tested, so libmariadb-dev must be present on all
runners. The postgres migration job and pytest postgresql matrix were
missing this step.
2026-03-16 11:40:39 +09:00
nendo
c59ea7790c test: add coverage for sync session handler, sync watcher, device masking, and auth utils
- test_sync_sessions_handler: increment_operations_completed (atomic
  counter, no-op on missing), NoResultFound on update/complete/fail
  with nonexistent session
- test_sync_watcher: _extract_device_and_platform path parsing (valid,
  non-incoming, too few parts, nested, outside base), _ensure_conflicts_dir
  creation and idempotency, process_sync_changes empty/disabled
- test_sync (endpoints): negotiate with untracked saves (no_op),
  server saves not mentioned by client (download), deleted-by-client
  detection (skip), complete on FAILED/CANCELLED session (400),
  trigger_push_pull passes session_id in enqueue kwargs
- test_device (endpoints): sync_config SSH credential masking
  (ssh_password/ssh_key_path -> "********"), null config passthrough,
  config without sensitive fields
- test_utils_auth: _get_device_name UA parsing (browser+OS, browser
  only, OS only, neither), create_or_find_web_device (creates new,
  returns existing on fingerprint match, updates last_seen)
2026-03-16 11:19:30 +09:00
nendo
4edb1710a5 fix: address review feedback on session handler and counter
- Restore NoResultFound behavior on update_session, complete_session,
  fail_session when row is missing (scalar returns None, old .one()
  raised -- silent None is a semantic regression)
- Remove redundant get_session call from _increment_session_counter;
  the atomic SQL increment is already a no-op on missing rows
- Log warning when passed session_id is not found in _sync_device
  instead of silently creating an orphan session
2026-03-16 10:59:49 +09:00
nendo
55638d15dc fix: address bugs, security issues, and convention violations in save-sync
- Fix broken path construction in FSSyncHandler: build_* methods now
  return relative paths; sync_watcher uses paths relative to sync base
  instead of CWD (was completely non-functional in production)
- Fix SSH connection leak in push-pull task: conn.close() now in finally
- Add log.warning for disabled SSH host key verification
- Fix race condition in session operation counter: use atomic SQL
  increment instead of read-then-write
- Extract _increment_session_counter helper, add exc_info to warnings
- Replace legacy session.query() with select() in sync_sessions_handler
- Fix orphaned session: trigger_push_pull now passes session_id to job
- Fix wasteful SSH download when no matched_save exists
- Fix BaseModel import collision in sync.py (pydantic -> project base)
- Fix ORM mutation in UserSchema.from_orm_with_request: set field on
  schema instance instead of mutating live ORM object
- Mask ssh_password and ssh_key_path in DeviceSchema API response
- Fix migration PostgreSQL compatibility: condition ON UPDATE clause
  on MySQL, drop enum in downgrade
- Rename copy-paste artifact rom_user_status_enum
2026-03-16 10:56:43 +09:00
Georges-Antoine Assi
c61f52ebed clean create web device 2026-03-15 20:25:38 -04:00
Georges-Antoine Assi
e1b07cacfc make devices actually unique 2026-03-15 20:09:33 -04:00
Georges-Antoine Assi
29112b4ddc create device on login web 2026-03-15 11:25:39 -04:00
Georges-Antoine Assi
3f7953b020 update responses 2026-03-15 09:48:31 -04:00
Georges-Antoine Assi
87800ffd5e run generate 2026-03-15 09:35:12 -04:00
Georges-Antoine Assi
55ca39cacb fix deprecations in pydantic 2026-03-15 09:34:48 -04:00
Georges-Antoine Assi
7013cf9e73 remove plan 2026-03-14 23:58:28 -04:00
Georges-Antoine Assi
ed6f9f5907 cleanup endpoint tests 2026-03-14 23:56:46 -04:00
Georges-Antoine Assi
b3fbbf59fb add tests 2026-03-14 23:35:04 -04:00
Georges-Antoine Assi
f13f929d7d tweaks based on self review 2026-03-14 22:26:53 -04:00
Georges-Antoine Assi
e6ddc5da11 bot attempt at save sync 2026-03-14 22:13:38 -04:00
Georges-Antoine Assi
3e65534d6e remove unnceserray upload checks 4.8.0-alpha.1 2026-03-13 17:40:45 -04:00
Georges-Antoine Assi
68ead66c9b Merge pull request #3133 from rommapp/pre-4.8-cleanup
Pre-4.8 cleanup
2026-03-12 23:19:13 -04:00
Georges-Antoine Assi
ffbd997940 remove unused test 2026-03-12 23:14:17 -04:00
Georges-Antoine Assi
4db997d69f update env.template 2026-03-12 23:11:42 -04:00
Georges-Antoine Assi
997e2c44aa start pre-4.8 cleanup 2026-03-12 23:02:12 -04:00
Georges-Antoine Assi
2beba3d141 move to corrrect folder 2026-03-12 21:15:08 -04:00
Georges-Antoine Assi
7c0e5400f7 add more tools to setup copilot 2026-03-12 21:14:31 -04:00
Georges-Antoine Assi
78ff3c1e54 add copilot setup steps 2026-03-12 20:58:46 -04:00
Georges-Antoine Assi
8b335886c5 Merge pull request #3131 from rommapp/copilot/ui-ux-optional-cover-image-bevel
Remove cover image card bevel
2026-03-12 20:34:04 -04:00
Georges-Antoine Assi
a2be62154b Merge pull request #3118 from rommapp/copilot/update-game-status-retroachievements
feat: Auto-update game status from RetroAchievements award kind during progress sync
2026-03-12 20:31:35 -04:00
Georges-Antoine Assi
7146081d75 dont update user set statutuses 2026-03-12 20:26:30 -04:00
Georges-Antoine Assi
72e884a83c run fmt 2026-03-12 19:02:24 -04:00
copilot-swe-agent[bot]
87c6da4d59 Remove bevel from game card cover image by changing elevated to flat variant
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-03-12 23:01:29 +00:00
Georges-Antoine Assi
405130c844 Merge pull request #3126 from HydroSulphide/feat-configurable-token-expiry-env
Make OAuth token expiry configurable via env vars
2026-03-12 19:00:30 -04:00
copilot-swe-agent[bot]
4234ca3953 fix: always update rom_user status from RA award on each sync run
Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-03-12 22:59:47 +00:00
copilot-swe-agent[bot]
50bc386068 Initial plan 2026-03-12 22:57:35 +00:00
Georges-Antoine Assi
d5cb2356d2 ignore greptiles comments 2026-03-12 18:47:02 -04:00
Georges-Antoine Assi
57bef89e2a Merge pull request #3130 from milktoastrat/patch-1
Remove Non-Argosy Android app references from README
2026-03-12 16:18:48 -04:00
milktoastrat
6e8f4c39d6 Remove deprecated project links from README
Removed links to 'romm-mobile' and 'romm-android' from the README.
2026-03-12 16:05:46 -04:00
milktoastrat
3acf73630e Remove Non-Argosy Android app references from README
Removed references to Android and iOS apps from the Mobile section.
2026-03-12 15:52:40 -04:00
HydroSulphide
6a1c1597ce Fix: directly import constants from config and preventing silent fallback on wrong user input for env variable 2026-03-12 20:18:48 +01:00
HydroSulphide
48091225c7 Fix: imports in all test files with renamed constants 2026-03-12 20:04:19 +01:00
HydroSulphide
61c0d401d4 Fix: conftest.py now using the renamed constants 2026-03-12 19:55:50 +01:00
HydroSulphide
0f6e849b16 Implemented startup validation for positive values 2026-03-12 08:48:59 +01:00
HydroSulphide
fe4d42e192 removed unused import "Final" 2026-03-12 06:55:45 +01:00
HydroSulphide
8293c7ba9b Make OAuth token expiry configurable via env vars 2026-03-12 06:48:48 +01:00