Skip to content

[Feature] Add updated_since query parameter to Platform and Rom endpoints #2874

@BrandonKowalski

Description

@BrandonKowalski

Is your feature request related to a problem? Please describe.
This is a follow up to #2810 after spending more time with the problem.

Network calls are the bottleneck for Grout on cheap handhelds.

I've started implementing a basic JSON file cache as I explore the problem space. All signs are pointing to the need for a local SQLite database to store this data sanely.

The problem is keeping this cache in sync with RomM.

Describe the solution you'd like
Add a new query parameter updated_since (or another name that makes sense) to the Platform and Rom endpoints. Additionally, it looks like an index will need to be added to both the platforms and roms tables for the updated_at column.

Describe alternatives you've considered
I started with the solution proposed in #2810 to do a limit 1 query ordered by updated_at descending. This does help identify a stale cache. However, refreshing the cache with this scheme is an expensive operation as it requires an entire pull, even if only one thing changed.

Additional context
This won't solve everything. The first sync will still require pulling everything. I'm hoping for huge collections #2811 will help with the performance of a full pull. After the first pull these requested changes will bring efficiency. Additionally, I believe other client projects would benefit from this change.

The only gap with this solution is it does not assist with deletes. I'm guessing a logical delete isn't in the cards so a new endpoint that enumerates a current list of ids (platforms and roms) would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions