Skip to content

Potential get_most_recent_status_id problem with bookmarks and favourites. #26

@oscherler

Description

@oscherler

I think there’s a small mistake here:

def get_most_recent_status_id(db: Database) -> Optional[int]:
"""
Get the most recent status ID from the SQLite database.
"""
table = get_table("statuses", db=db)
row = next(
table.rows_where(order_by="created_at desc", select="id", limit=1),
None,
)

Indeed, this method is used to download your posts that are more recent than the most recent post already in the database. But since favourites and bookmarks are saved in the same table, it means that if I do this:

  1. Download statuses and bookmarks;
  2. Wait a week;
  3. Bookmark a recent post;
  4. Download bookmarks;

then if I try and update statuses, the most recent status ID will be the one of the bookmark I just saved, instead of the ID of the last of my own posts we downloaded.

I’m working on a better way to update the database, so it might not be an issue once I’m done, but in the meantime, I thought I’d document it here, in case someone happens to have trouble with this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions