Skip to content

Storage → Test connection verifies conditional writes - #144

Merged
revett merged 2 commits into
mainfrom
revett/fix/141
Jul 27, 2026
Merged

revett merged 2 commits into
mainfrom
revett/fix/141

Conversation

@revett

@revett revett commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #141

Problem

  • testConnection reported success the moment a provider accepted the credentials, never checking the conditional writes sync's compare-and-swap depends on
  • Providers that reject conditional writes, or accept If-None-Match: * and silently ignore it, passed the test then either refused to sync or let concurrent edits overwrite each other with no error

Changes

  • Added a conditional write probe that runs after the credential check, writing and rereading a throwaway object under the reserved prefix to confirm the provider enforces If-None-Match: * and returns an ETag
  • Failed the connection test with a clear message when a provider ignores, rejects, or cannot support the writes sync needs
  • Covered each failure mode with unit tests, with the happy path exercised against real storage

Why

  • A connection test that passes for providers that lose edits is worse than none; this makes it answer the question it claims to, before a vault ever trusts the bucket

Greptile Summary

Adds a storage compatibility probe that:

  • Verifies providers enforce conditional object creation.
  • Confirms successful reads return an ETag.
  • Deletes the temporary probe object without allowing cleanup rejection to replace the probe verdict.
  • Adds unit coverage for supported providers and each compatibility failure mode.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/storage/storage.ts Adds the conditional-write probe to connection testing and safely suppresses rejected best-effort cleanup.
src/storage/storage.test.ts Covers successful probing, ignored or rejected conditions, missing ETags, reserved-prefix cleanup, and cleanup rejection.

Reviews (2): Last reviewed commit: "Address comment around error handling" | Re-trigger Greptile

Comment thread src/storage/storage.ts
@revett
revett merged commit 26e1462 into main Jul 27, 2026
10 checks passed
@revett
revett deleted the revett/fix/141 branch July 27, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage → Test connection passes for providers that can't do conditional writes

1 participant