Skip to content

Write about invariants & expectations for views #8

@cinnamon-bun

Description

@cinnamon-bun

It would be nice to clearly specify what a view can expect. I'm not sure this is correct:

  • Messages will be processed in any order, even within a single feed (?)
  • Messages will be processed exactly once each. If you have storeState and fetchState then processing will pick up where it left off last time; otherwise it starts from scratch each time.
  • What happens when only part of a hypercore is downloaded, and then the rest shows up later? Does the saved progress state assume a single moving front of completed processing or does it know there could be mixed regions of processed and unprocessed messages?
  • If views want to persist their internal state (such as sum in the example) they need to do that in map (and not call next() until the persist is complete)
  • What happens if your map doesn't call next()? Is this an ok way to abort processing?
  • Is it safe for a view to pause itself from inside map?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions