Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwingStore hostStorage setExportCallback is unsafe #10062

Open
gibson042 opened this issue Sep 11, 2024 · 1 comment · May be fixed by #10063
Open

SwingStore hostStorage setExportCallback is unsafe #10062

gibson042 opened this issue Sep 11, 2024 · 1 comment · May be fixed by #10063
Labels
bug Something isn't working

Comments

@gibson042
Copy link
Member

Describe the bug

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 exportCallback at 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).

@mhofman
Copy link
Member

mhofman commented Sep 11, 2024

Possibly related: #9655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants