rocicorp / replicache

Realtime Sync for Any Backend Stack
https://doc.replicache.dev
1.05k stars 37 forks source link

API design for onClientStateNotFoundError #895

Closed arv closed 2 years ago

arv commented 2 years ago

212797317a92afe88c5215fb42a03204232dcb7b added server side generated error for client not found. AKA "new phone, who dis"

When this happens we call Replicache onClientStateNotFoundError({type :'NotFoundOnServer'}

Another design direction is to have a catch all onError callback and may pass in the Error (or some constant that can be matched against)

See #462 for other usages of onError.

If we use onError, it is tempting to use an Event with preventDefault where the default action is to reload when the page.

Needs some more thinking...