Skip to content
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

Split Feed model #1207

Open
twm opened this issue Jul 20, 2024 · 2 comments
Open

Split Feed model #1207

twm opened this issue Jul 20, 2024 · 2 comments

Comments

@twm
Copy link
Owner

twm commented Jul 20, 2024

Much like Article in #415, the Feed model mixes server-set and client-set fields. Unlike that issue the primary concern here is lost updates.

Server-set fields

  • url — may be updated
  • next_check, last_checked, last_changed — timestamps
  • error
  • etag, last_modified, digest
  • feed_title, site_url — feed metadata

Client-set fields

  • url — entered by the user
  • created, deleted
  • user_title

Server- and client-set fields

  • all_count
  • unread_count
  • fave_count

Proposed changes

Split into a few models:

Feed

Defines a feed to check. Contains the client-set fields.

The url field contains the URL originally entered by the user.

FeedState

Contains the server-set fields.

The current_url field contains the URL after persisting any permanent redirects.

FeedCounts

Contains all_count, unread_count, and fave_count. Maintained exclusively by triggers?

@twm twm moved this from To do to In progress in Yarrharr fetch pipeline Jan 20, 2025
@twm
Copy link
Owner Author

twm commented Jan 20, 2025

Perhaps instead:

Proposed changes

Feed

Defines a feed to check. Contains the client-set fields, plus next_check.

FeedPoll

Represents one poll of the feed.

Fields:

  • date — replaces Feed.last_checked
  • changed — boolean, replaces Feed.last_changed
  • error, etag, last_modified, digest — as the Feed fields
  • resolved_url — URL after any HTTP redirects

Lifecycle:

  • Created upon completion of a poll.
  • They are retained for a limited time (366 days?) for visualization/debugging purposes
  • The most recent FeedPoll (if any) is consulted when polling the new feed

@twm
Copy link
Owner Author

twm commented Jan 20, 2025

(I think that I am thinking to hard about this. Lost updates were a concern when Yarrharr was an SPA and I was looking at syncing the full state, but it's just not that likely for an SSR app with a low rate of change.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

1 participant