You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As documented, "hostStorage.setExportCallback() is used to register an export callback after swingstore creation [but] Most applications will instead provide options.exportCallback to openSwingStore()". But looking at the implementation, noteExport performs a database write if and only if there is a defined exportCallbackat the time. This means that calling setExportCallback too late will result in the callback seeing only a subset of exports when it is later called, which is a footgun.
Proposed solution
We should just remove the method, since the exportCallback option provides equivalent functionality and doesn't suffer from the same issue (and in fact we never even use setExportCallback, even in testing).
The text was updated successfully, but these errors were encountered:
Describe the bug
As documented, "
hostStorage.setExportCallback()
is used to register an export callback after swingstore creation [but] Most applications will instead provideoptions.exportCallback
toopenSwingStore()
". But looking at the implementation,noteExport
performs a database write if and only if there is a definedexportCallback
at the time. This means that callingsetExportCallback
too late will result in the callback seeing only a subset of exports when it is later called, which is a footgun.Proposed solution
We should just remove the method, since the
exportCallback
option provides equivalent functionality and doesn't suffer from the same issue (and in fact we never even usesetExportCallback
, even in testing).The text was updated successfully, but these errors were encountered: