Skip to content

🐛 Setting save_exchange_record=False does not promptly delete the record after exchange is complete #957

@ff137

Description

@ff137

At the moment, this is only an issue for our tests. Namely: app/tests/e2e/issuer/test_save_exchange_record.py::test_issue_credential_with_save_exchange_record

In this e2e test we validate that a 404 is raised when trying to fetch the credential exchange record, after the exchange was complete, and if save_exchange_record was set to False.

Previously, we've identified some race condition, where it may take a moment for the records to update. Therefore, a naive workaround was to add a sleep of 1 second. This is fairly "long" in computational terms, so it was thought to be sufficient.

This did make the test failure rare, but it can still occur -- i.e. it can happen that the record has still not been deleted, 1 second after the exchange was complete.

This should be fine for most client use cases, since a short delay is acceptable. But all we can know from the test failure is that it took more than 1 second, and so we can't guarantee that the bug is not actually that it never gets deleted ...

A possible solution would be to replace the 1 second sleep with some fast retry logic, so it can pass as quickly as possible, and only fails if it takes, let's say, more than 5 seconds.

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