Commit Graph

88 Commits

Author SHA1 Message Date
Georges-Antoine Assi
ccf5f656b7 Add if_not_exists/if_exists guards to all alembic add_column/drop_column ops 2026-04-09 22:50:07 -04:00
Georges-Antoine Assi
f227a3145d changes from bot review 2026-04-07 22:32:40 -04:00
Georges-Antoine Assi
f2619ac0d1 Merge branch 'master' into pegasus-metadata-export 2026-04-06 11:06:08 -04:00
Georges-Antoine Assi
f2e8e337b2 Merge branch 'master' into save-sync 2026-04-05 21:47:53 -04:00
Georges-Antoine Assi
e0214f100d more bot cleanup 2026-04-05 19:15:33 -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
d13e7b6783 fix tests again 2026-03-22 00:03:29 -04: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
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
55ca39cacb fix deprecations in pydantic 2026-03-15 09:34:48 -04:00
Georges-Antoine Assi
b3fbbf59fb add tests 2026-03-14 23:35:04 -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
Georges-Antoine Assi
f0e5abadc9 fix tests again 2026-03-10 09:23:12 -04:00
HydroSulphide
b9ea937373 Merge branch 'master' into fix-oauth-token-expiry-and-refresh-rotation 2026-03-10 08:51:44 +01:00
HydroSulphide
02336974a6 Implemented greptile suggestions 2026-03-10 08:04:07 +01:00
HydroSulphide
8758cb31b7 Tried to fix everything the bot complained about and the failed pytests.
Three tests were also implemented to check initial implementation that now invalidates expired access and refresh tokens and also rotating refresh tokens.

Since I introduced wrapper functions for create_oauth_token to distinguish between access and refresh token there is no need to set the token type in the data dict, since the type is now enforced in the wrapper functions create_access_token and create_refresh_token.

By convention I renamed create_oauth_token to _create_oauth_token as it is considered a private helper function now.
2026-03-10 07:22:02 +01:00
copilot-swe-agent[bot]
2a7c86e304 Fix OIDC login downgrading existing user roles when no claims provided
Co-authored-by: pacnpal <183241239+pacnpal@users.noreply.github.com>
2026-03-09 18:26:49 +00:00
copilot-swe-agent[bot]
ae73da7c27 Fix 500 error from empty fs_name_no_tags causing mass sibling matching and incorrect ROM grouping
- Add migration 0071 to fix sibling_roms view: add guard against empty string matching for fs_name_no_tags
- Fix group_by_meta_id in filter_roms: use func.nullif to treat empty fs_name_no_tags as NULL in grouping key
- Add group_by_meta_id support to get_roms_scalar
- Add tests for sibling matching behavior with empty/non-empty fs_name_no_tags

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
2026-03-08 23:17:51 +00:00
Georges-Antoine Assi
29a09d3787 fix tests 2026-03-08 10:52:56 -04:00
Georges-Antoine Assi
75d38cc937 add tests 2026-03-08 10:27:01 -04:00
Georges-Antoine Assi
aa4abe6b7c end me 2026-03-07 23:43:58 -05:00
Georges-Antoine Assi
2feb43571b my brain is bumb 2026-03-07 23:32:04 -05:00
Georges-Antoine Assi
606799e19c my own cleanup 2026-03-07 21:34:45 -05:00
Georges-Antoine Assi
61aface9ae cleanup 2026-03-07 19:04:14 -05:00
Georges-Antoine Assi
92ef2cf676 some fixes 2026-03-07 18:37:29 -05:00
Georges-Antoine Assi
5f2c1a6b3b fix tests 2026-03-07 18:24:31 -05:00
Georges-Antoine Assi
b21aa662b5 add test file 2026-03-07 16:24:22 -05:00
Georges-Antoine Assi
661a5504d7 find a couple more uses 2026-02-09 17:26:21 -05:00
Georges-Antoine Assi
37436fddb7 changes from self review 2026-02-06 10:31:08 -05:00
Georges-Antoine Assi
e36d7650e7 [ROMM-2989] Split search term by | 2026-02-06 10:20:14 -05:00
nendo
220d7531e7 refactor(saves): replace order_by_updated_at_desc with flexible order_by
Add order_by and order_dir parameters to get_saves() for flexible
sorting. Supports "updated_at" and "created_at" fields with "asc" or
"desc" direction (default: desc). Enables ascending order for pruning
scenarios.
2026-02-03 20:06:09 +09:00
nendo
a236123e4f feat(saves): add slot-based save sync with content hash deduplication
- Add device registration and save synchronization
- Implement slot-based save organization with datetime tagging
- Add conflict detection for multi-device sync scenarios
- Add content hash computation for save deduplication
- Support ZIP inner-file hashing for consistent deduplication
- Add confirm_download endpoint for sync state management
- Add overwrite parameter to bypass conflict checks
2026-01-31 21:57:22 +09:00
Georges-Antoine Assi
1602688d08 fix one more test 2026-01-19 12:48:54 -05:00
Georges-Antoine Assi
dd5935f50c fix tests 2026-01-19 12:20:11 -05:00
zurdi
bd52217462 Refactor library structure detection to use enum values for consistency 2026-01-02 13:09:37 +00:00
zurdi
cc816822d8 Refactor library structure detection to use enum values and update related tests and frontend logic 2026-01-02 11:54:29 +00:00
zurdi
06a1598bcc Merge remote-tracking branch 'origin/master' into romm-1371 2026-01-02 11:12:36 +00:00
Zurdi
6295d5b8cd Merge pull request #2411 from rommapp/feat/rom-filter-multivalue
feat: Support for multi-value filters
2025-12-31 16:19:04 +01:00
Georges-Antoine Assi
bdc7c265f1 fix tests 2025-12-30 11:44:42 -05:00
Georges-Antoine Assi
f867968f37 refactor get_rom_files return value 2025-12-30 11:42:38 -05:00
Georges-Antoine Assi
0971026f95 Add support for version tag 2025-12-30 11:37:06 -05:00
zurdi
647e99fca7 Add last played filter to ROMs retrieval and update related tests 2025-12-30 12:53:12 +00:00
zurdi
ab637203ac Merge branch 'master' into feat/rom-filter-multivalue 2025-12-24 12:39:45 +00:00
zurdi
cbe64ce29c test: add tests for library structure detection in FSPlatformsHandler 2025-12-23 16:24:33 +00:00
zurdi
ecf4ae542f fix: correct spelling of 'get_platform_fs_structure' in multiple files 2025-12-21 16:48:45 +00:00
Georges-Antoine Assi
76e67c7844 [HOTFIX] Catch RomsNotFoundException in scan file precalculation 2025-12-09 08:53:28 -05:00
Georges-Antoine Assi
f1fb0c726e Disable fastapi_test 2025-12-07 10:40:07 -05:00
zurdi
c1d43f67f8 Refactor ROM retrieval to support multi-value platform filtering across various handlers and endpoints 2025-11-27 22:52:33 +00:00