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

Standalone push does not error on existing invoice #335

Open
itowlson opened this issue May 9, 2022 · 0 comments
Open

Standalone push does not error on existing invoice #335

itowlson opened this issue May 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@itowlson
Copy link
Contributor

itowlson commented May 9, 2022

Scenario:

  • A Bindle server already contains an invoice named foo/1.0.0
  • Unaware of this, I create a new bindle named foo/1.0.0 and prepare it locally as a standalone bindle
  • I use bindle push or the StandaloneRead::push method to push my bindle to the server

Expected behaviour: an error saying "that invoice already exists"

Actual behaviour: no error and my push is silently ignored

It seems that a standalone push checks if the invoice exists, and if it does, it attempts to upload any of the existing invoice's missing parcels from the standalone bindle. In this case, the invoice in the standalone bindle is entirely ignored.

The "fill in what's missing" behaviour is convenient when it's, say, retrying an interrupted operation. But the side effect of "silently do nothing" when someone reuses an ID is not.

Options:

  • If the ID exists, compare the server and standalone invoices (somehow) and error if they are not the same, otherwise use existing behaviour
  • Error by default if the invoice exists (without checking), but provide an option so the user can express "it's okay if the invoice exists because I'm confident it's the same"
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

No branches or pull requests

2 participants