Skip to content

Fix: Unix time epoch bug in 'Saved' tab#23

Merged
mardous merged 1 commit intomardous:masterfrom
AbhxyDxs:master
Nov 1, 2025
Merged

Fix: Unix time epoch bug in 'Saved' tab#23
mardous merged 1 commit intomardous:masterfrom
AbhxyDxs:master

Conversation

@AbhxyDxs
Copy link
Contributor

When saving a single status, its "Saved date" in the "Saved" tab would incorrectly show as "1 Jan 1970" [Unix time epoch issue].
This was because the save timestamp was not being recorded in the function.
Even after fixing the timestamp, the "Saved" tab would not update its UI until a manual pull-to-refresh was performed, due to a state management race condition.

  • [1] Timestamp issue for single status save fixed in StatusesRepositoryImpl.kt
  • [2] Added a call to loadSavedStatuses() inside the saveStatus function. This ensures that after a single save completes, a refresh of the "Saved" list is immediately triggered.
  • [3] Added an onResume() override to the SavedStatusesFragment. This function is called every time the Saved tab becomes visible. By calling onRefresh() (which calls viewModel.loadSavedStatuses()) inside onResume(), we make sure the "Saved" tab always loads the newest data from the database the moment it appears, defeating the race condition.

Single status save was't carrying timestamp, so it caused a unix time epoch in db [1 Jan 1970 as date for each singly saved status] also the saved statuses was not reloading after each save, so we had to manually refresh in-order to view the actual saved date
@mardous
Copy link
Owner

mardous commented Nov 1, 2025

Hi, thanks for this. I'll check it out as soon as I have some time.

@mardous mardous self-requested a review November 1, 2025 22:31
Copy link
Owner

@mardous mardous left a comment

Choose a reason for hiding this comment

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

Thanks

@mardous mardous merged commit dba709b into mardous:master Nov 1, 2025
1 of 3 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.

2 participants