Skip to content

fix: upload session events in FIFO order#1716

Merged
meladRaouf merged 1 commit into
release/2026.2.1from
bugfix/fifo-upsync-release
Jun 23, 2026
Merged

fix: upload session events in FIFO order#1716
meladRaouf merged 1 commit into
release/2026.2.1from
bugfix/fifo-upsync-release

Conversation

@meladRaouf

Copy link
Copy Markdown
Collaborator

Same PR for release with minimum changes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes the local Room DAO query ordering so closed session scopes and their events are fetched in FIFO (oldest-first) order, aligning event up-sync with chronological upload rather than LIFO.

Changes:

  • Update SessionScopeRoomDao.loadClosed() to return closed scopes ordered oldest-first.
  • Update EventRoomDao queries (loadAll, loadFromScope, loadEventJsonFromScope) to return events ordered oldest-first.
  • Add/extend DAO unit tests to assert FIFO ordering and limit behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
infra/events/src/main/java/com/simprints/infra/events/event/local/SessionScopeRoomDao.kt Changes loadClosed query ordering to start_unixMs asc for FIFO retrieval of closed scopes.
infra/events/src/main/java/com/simprints/infra/events/event/local/EventRoomDao.kt Changes event retrieval queries to createdAt_unixMs asc so events are fetched in FIFO order.
infra/events/src/test/java/com/simprints/infra/events/event/local/SessionScopeRoomDaoTest.kt Adds tests verifying FIFO ordering and limit behavior for closed scopes.
infra/events/src/test/java/com/simprints/infra/events/event/local/EventRoomDaoTest.kt Adds tests verifying FIFO ordering for scope event and event JSON retrieval.

Comment thread infra/events/src/main/java/com/simprints/infra/events/event/local/EventRoomDao.kt Outdated
Change ORDER BY in SessionScopeRoomDao.loadClosed from DESC to ASC
so older sessions are prioritised over newer ones during upload.

Add SessionScopeRoomDaoTest to verify FIFO ordering is preserved.
@meladRaouf meladRaouf force-pushed the bugfix/fifo-upsync-release branch from 26662a0 to 967bd0c Compare June 22, 2026 17:35
@sonarqubecloud

Copy link
Copy Markdown

@meladRaouf meladRaouf requested a review from BurningAXE June 23, 2026 10:36
@meladRaouf meladRaouf merged commit f81842b into release/2026.2.1 Jun 23, 2026
14 checks passed
@meladRaouf meladRaouf deleted the bugfix/fifo-upsync-release branch June 23, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants