Skip to content

Fix/update at - #105

Merged
andrewtavis merged 3 commits into
scribe-org:mainfrom
DeleMike:fix/update_at
Oct 5, 2026
Merged

andrewtavis merged 3 commits into
scribe-org:mainfrom
DeleMike:fix/update_at

Conversation

@DeleMike

@DeleMike DeleMike commented Oct 5, 2026

Copy link
Copy Markdown
Member

Contributor checklist

  • This pull request is on a separate branch and not the main branch
  • I have ran the ./pre-commit executable as well as make lint and have fixed all reported issues

Description

This PR fixes the issue as stated in #104.

  1. Old data backups on Toolforge are removed. Each deployment moves the current SQLite packs into a packs/sqlite.backup.<date> folder, and these were never deleted. The deploy step now keeps only the two most recent backups, so there's always the one just made plus one older for a rollback.

  2. updated_at now matches data-version. Scribe-Server always set updated_at in the GET /api/v1/data/{lang} response to the date of the API request. This was set during my initial development of the API. GET /api/v1/data-version/{lang} already has the correct dates, which client apps can ping to know whether they need to get new data. This PR sets updated_at to the most recent of those data-version dates, so both endpoints agree.

    For example, for English:

    • data-version: nouns 2026-09-30, verbs 2026-09-28, profanity 2026-10-01
    • updated_at: 2026-10-01 (previously the date of the request)

Testing

  • Added unit tests for picking the most recent date (database/versions_test.go).
  • Ran the server locally and checked that updated_at matches the newest data-version date for en, de and ru.
  • Tested the backup cleanup on sample backup folders: only the two newest are kept, and packs/sqlite isn't touched.

Related issue

@DeleMike
DeleMike requested review from andrewtavis and axif0 October 5, 2026 09:34
@DeleMike DeleMike self-assigned this Oct 5, 2026

@andrewtavis andrewtavis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

praise: This all looks great and makes total sense, @DeleMike! Thanks for deriving the issue here and sending along the fix! 😊

@andrewtavis
andrewtavis merged commit 566d52c into scribe-org:main Oct 5, 2026
3 checks passed
@DeleMike

DeleMike commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Thanks! I will now run the process :)

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.

updated_at is always the request date, and Toolforge keeps every data backup

2 participants