Skip to content

Fixs#63

Merged
Tyjfre-j merged 18 commits into
developfrom
fixs
Jul 6, 2026
Merged

Fixs#63
Tyjfre-j merged 18 commits into
developfrom
fixs

Conversation

@Tyjfre-j

@Tyjfre-j Tyjfre-j commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Changes summary

Queries naming changes

  • stuff_user.sql to staff_user.sql
  • eventParticipant.sql to event_participant.sql

Scope sys.modules mocking in photo worker tests

  • Limit sys.modules mocking to only the imports that require it.
  • Restore the original modules after the test setup.
  • Prevents mocked modules from leaking into subsequent test files.

Reset Redis singleton on shutdown

  • Reset RedisClient._instance to None in close().
  • Allows subsequent application lifecycles (such as multiple TestClient instances in pytest) to initialize Redis cleanly.

Ensure NATS client cleanup always completes

  • Wrap NatsClient.close() cleanup in a try/finally.
  • Reset internal singleton state even if drain() raises (for example, due to a timeout).
  • Prevents stale client state from affecting later tests.

@ademboukabes ademboukabes self-requested a review July 4, 2026 21:02
@Tyjfre-j

Tyjfre-j commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Worker/deployment fixes

  • Added email-worker to the run-workers command, which was previously missing
  • Fixed the env var prefix used in notification settings so Firebase/notification config binds correctly
  • Fixed storage-cleaner's DB connection setup
  • Added missing background workers to both the mobile quickstart Docker Compose file and the staging Docker Compose file

Documentation

  • Updated mobile quickstart run docs

Dependencies

  • Removed the duplicate opencv-python dependency alongside opencv-python-headless — both install into the same cv2 namespace, which is undefined behavior when both are present; kept only the headless build since this is a server with no GUI requirement

@Tyjfre-j

Tyjfre-j commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Upload groups N+1 fix

  • list_groups was calling get_group_details() once per group in a loop (1 + 2N queries for N groups) — replaced with a direct return of the flat group rows, since the list endpoint doesn't need nested requests/photos

  • Added UploadRequestGroupSummarySchema for GET /staff/uploads/groups, used only by that endpoint
    Left get_group_details() untouched — confirmed all other call sites (approve, reject, single-group fetch, review flow) operate on one group at a time, no other N+1 spots

  • GET /staff/uploads/groups now does 1 query regardless of queue size, down from 1 + 2N

@Tyjfre-j Tyjfre-j merged commit 0455b8f into develop Jul 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants