• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pomerium / pomerium / 38771402980
54%

Build:
DEFAULT BRANCH: main
Ran 15 Oct 2026 05:02PM UTC
Jobs 1
Files 723
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Oct 2026 04:43PM UTC coverage: 53.572% (-0.03%) from 53.597%
38771402980

push

github

web-flow
fix(databroker): postgres conditional write must not restore a deleted record (#6857)

## Summary

On Postgres, a conditional `Put` (`if_match_version`) at version N > 0
succeeds when the record was deleted after it was read, and re-creates
it. The file and in-memory backends reject that write with
`RECORD_VERSION_MISMATCH`, since a deleted record has no stored version.

Postgres now does the same. A conditional write at version N > 0 only
updates a record that still exists at version N; otherwise it fails with
`RECORD_VERSION_MISMATCH` and nothing in the batch is written. Only a
version-0 write can create a record. This holds when the delete is
concurrent too: the write waits for the delete, then fails instead of
re-creating the record. The write stays a single compare-and-swap
statement with no extra locking. Unconditional `Put`, conditional
creates and conditional deletes are unchanged.

Without this, a read-then-conditional-write caller can undo a delete: a
session refresh racing a revocation brings the revoked session back.

## Related issues

Fixes a regression from #6773. It is in no release yet, so no backport.

## User Explanation

None. Internal databroker API; the bug is unreleased.

## AI disclosure

Claude Code wrote the fix and tests from my bug description and
constraints; I reviewed.

## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [ ] add appropriate label (`bug`)
- [x] disclosed AI usage (or wrote "none") per AI_POLICY.md
- [ ] ready for review

13 of 25 new or added lines in 2 files covered. (52.0%)

28 existing lines in 10 files now uncovered.

34842 of 65038 relevant lines covered (53.57%)

316.75 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
0.0
0.0% pkg/storage/storagetest/storagetest.go

Coverage Regressions

Lines Coverage ∆ File
7
75.21
-1.41% pkg/storage/postgres/backend.go
6
72.8
-4.8% pkg/grpcutil/client_manager.go
4
72.78
-1.27% internal/databroker/config_source.go
2
46.71
0.45% internal/databroker/server_clustered_follower.go
2
89.13
-4.35% pkg/fanout/receive.go
2
96.05
-2.63% pkg/identity/manager/schedulers.go
2
88.21
0.58% pkg/storage/postgres/postgres.go
1
92.86
-3.57% pkg/fanout/fanout.go
1
84.13
-0.17% pkg/ssh/stream.go
1
73.21
0.0% pkg/storage/postgres/registry.go
Jobs
ID Job ID Ran Files Coverage
1 38771402980.1 15 Oct 2026 05:02PM UTC 723
53.57
GitHub Action Run
Source Files on build 38771402980
  • Tree
  • List 723
  • Changed 13
  • Source Changed 2
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #38771402980
  • 0a822b57 on github
  • Prev Build on main (#38484587904)
  • Next Build on main (#38775340547)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc