Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Standalone push does not error on existing invoice #335

@itowlson

Description

@itowlson

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions