We currently attach a ContentStatus struct to Doc InsertRemote events. ContentStatus is a three-state enum of { Missing, Complete, Incomplete }
Feature Request
I'm requesting two new features:
Add a ContentStatus query parameter that will filter the returned Entries from a query. Parameter should accept the following combinations:
Any: no filtering, return all entries as we do now
Missing: return only blobs that have no data cached locally
Missing | Incomplete: return blobs all blobs that are not complete
Complete: return only blobs that are complete and local
Incomplete: return only blobs that are partially local
Complete | Incomplete: return blobs that are not missing
Add a content_status field/accessor to the return value of an Entry, which will always have a value of { Missing, Incomplete, Complete }.
Use Case
I'm building a photo sharing app, where each entry in a document points to a png image. When the document syncs to the device, I'm running a query for all of the latest entries in the document, displaying thumbnails of all photos in a grid view. The grid view is generated with an "all keys merged by latest time stamp" query. The problem at the moment: during initial sync, the query returns numerous keys that we don't currently have the content for. Right now the best iroh offers is to subscribe to events, looking for changes in content_status. This is incomplete at best.
Both features play a useful role: Being able to query for only complete content makes rolling out the initial version of the app easy: listen for any document event, and re-run a query with the ContentStatus: Complete filter, displaying the results (this can also power "show downloaded content only"-type features). Then later for a display that is less jumpy, we can relax the query to return any content status, and rely on the content_status field of the returned Entries to show placeholder images while we wait for them to load.
We currently attach a
ContentStatus
struct to DocInsertRemote
events. ContentStatus is a three-state enum of{ Missing, Complete, Incomplete }
Feature Request
I'm requesting two new features:
ContentStatus
query parameter that will filter the returned Entries from a query. Parameter should accept the following combinations:Any
: no filtering, return all entries as we do nowMissing
: return only blobs that have no data cached locallyMissing | Incomplete
: return blobs all blobs that are not completeComplete
: return only blobs that are complete and localIncomplete
: return only blobs that are partially localComplete | Incomplete
: return blobs that are not missingcontent_status
field/accessor to the return value of an Entry, which will always have a value of{ Missing, Incomplete, Complete }
.Use Case
I'm building a photo sharing app, where each entry in a document points to a png image. When the document syncs to the device, I'm running a query for all of the latest entries in the document, displaying thumbnails of all photos in a grid view. The grid view is generated with an "all keys merged by latest time stamp" query. The problem at the moment: during initial sync, the query returns numerous keys that we don't currently have the content for. Right now the best iroh offers is to subscribe to events, looking for changes in
content_status
. This is incomplete at best.Both features play a useful role: Being able to query for only complete content makes rolling out the initial version of the app easy: listen for any document event, and re-run a query with the
ContentStatus: Complete
filter, displaying the results (this can also power "show downloaded content only"-type features). Then later for a display that is less jumpy, we can relax the query to return any content status, and rely on thecontent_status
field of the returned Entries to show placeholder images while we wait for them to load.