Skip to content

feature: periodically remove stale gateway messages #5312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

jstuczyn
Copy link
Contributor

@jstuczyn jstuczyn commented Jan 6, 2025

this PR introduces a simple task that removes gateway messages that haven't been retrieved in (by default) 24h.


This change is Reviewable

@jstuczyn jstuczyn added this to the Hu milestone Jan 6, 2025
@jstuczyn jstuczyn requested review from octol and durch and removed request for octol January 6, 2025 12:37
Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-nextra ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 4:51pm
nym-next-explorer ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 4:51pm

@jstuczyn jstuczyn merged commit 226c040 into develop Jan 9, 2025
18 checks passed
@jstuczyn jstuczyn deleted the feature/periodic-stale-messages-removal branch January 9, 2025 09:03
@tommyv1987
Copy link
Contributor

Test Report: Automation Script for Data Cleanup Validation
Test Objective
Validate that the stale message cleanup mechanism in the database correctly removes records older than the configured threshold (24 hours).

Test Setup

  1. Environment:
    • SQLite database
    • Bash script: used to insert data.

Steps Performed

  1. Ran the insert_data.sh script to populate the database with test data:
    • Recent records inserted successfully.
  2. Verified the database content post-insertion: sqlite3 clients.sqlite "SELECT * FROM message_store;"
    • Confirmed that all 20 records (10 recent + 10 stale) were present.
  3. Allowed the system to run for 24 hours to trigger the cleanup mechanism.
  4. Queried the database again after 24 hours: sqlite3 gateway_storage.db "SELECT * FROM message_store;"

Expected Result

  • All stale records (older than 24 hours) should be removed.
  • Recent records should remain in the database.
    Actual Result
  • Query after 24 hours showed only the 10 recent records.
  • All 10 stale records were successfully removed.

Status: Pass

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