Repository navigation
Conversation
boughtHere no longer asks for released_at IS NULL, so an import or a replayed delete aimed at a number bought here and given back leaves the row as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
Reviewed 2d0144e9d merged onto origin/main 8e6e0bc, and also with #2305 (5cd388f6e) merged on top: both merges are clean, and DataMoveSuite passes on each. CI: this is a draft, so go and integration are skipped; CodeQL, GitGuardian and labeler pass. The full run happens at gh pr ready.
[Should fix] R1.1 CHANGELOG.md:926 (Unreleased, Bug Fixes): the line still says "A number bought here and still held is never updated or deleted by an imported row or a replayed change, whatever id it names." This PR also guards a given-back number, and acceleration/README.md:2918 already says "held or given back". Change the sentence to "A number bought here, held or given back, is never updated or deleted ...". This line is not in the diff, so it is here and not inline.
Checked and sound:
boughtHerehas two callers (import conflict, replayed delete). Both now guard every number with a vendor other thansip_trunk, held or given back.- A number given back here and then moved in on a trunk under another id imports live, and the given-back row stays as it was. A telnyx row naming a given-back id is skipped. A trunk number never bought here still imports, updates, is released and is deleted by a replayed delete. Another customer's row with a given-back id is refused with
ErrAnotherCustomersRow, as for a held one. - Billing: a number bought 75 days ago and given back 10 days ago, then hit by an imported
sip_trunkrow with its id.Rentals.Billbills 2 months on this head and 0 on base, where the row became a live trunk number. - The
released_atterm atdatamove.go:882tests the incoming row and is not a bought-here guard, so it is rightly left alone. - Mutations: 7 checked, 0 survived (restore the term, drop the guard at each site, invert, never-true, guard only given-back rows, old term at the delete site). Details:
AI-3686/pr/reviewer-1.mdin the ship-task ledger.
Verdict: no GO until R1.1 is fixed. There is no code finding.
| conflict += fmt.Sprintf(" AND %s.status <> '%s' AND %s.credentials_kek_version = 0", spec.name, ConnectionConnected, spec.name) | ||
| } | ||
| // A number bought here and still held is this deployment's, whatever row names its id. | ||
| // A number bought here, held or given back, is this deployment's, whatever row names its id. |
There was a problem hiding this comment.
[Question] R1.2 The guard is by id. Ids are per-deployment sequences carried as they are, so a source trunk number whose id equals the id of a number bought here is skipped: ImportRow returns nil, nothing is written, and the importer is told nothing. Probe: a trunk row with a different e164 and the id of a given-back number, and the same with a held one, both give nil and no row. The held case on main already does this, so this PR does not add a new kind of loss, but it adds given-back rows to it. Not for this PR: ticket it if the importer should get a skipped-row count or the id should be remapped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
R1.1 fixed in b7bf242. The CHANGELOG now says a number bought here, held or given back, is never updated or deleted by an imported row or a replayed change. The commit changes only that one line (checked by diff). R1.2, the silent skip when an id matches a guarded number (the held case does the same on main), becomes a ticket. Verdict: GO at b7bf242. |
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Delta review, round 2. Head b7bf242, previous reviewed head 2d0144e.
Prior findings:
- R1.1 (Should fix, CHANGELOG.md:926): fixed. The delta changes only that sentence, now "A number bought here, held or given back, is never updated or deleted by an imported row or a replayed change, whatever id it names." It matches the code:
boughtHerein acceleration/internal/store/datamove.go:1626-1631 has noreleased_atterm; the import conflict at datamove.go:958 and the replayed delete at datamove.go:2015 both use it. acceleration/README.md:2919 already says "held or given back". The tests behind the sentence are at acceleration/internal/store/datamove_test.go:3727, 3740 and 3752. They were not rerun, since the delta is one doc line. - R1.2 (Question, acceleration/internal/store/datamove.go:958): ticket, does not block. Unchanged by this delta. An imported number whose id equals a number bought here is skipped without an error. This is tracked as a ticket.
New findings: none in this delta.
CI at review time: every check passes except go, which is still in progress on this head.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PhoneNumbers.Release is gone from main (#2377). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Fixer round 3: the PR had gone stale against main. Merged origin/main (own commit). Main removed Mutation (restore |
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Delta round 3 of #2306. Head ba8f2c2, previous reviewed head b7bf242 (round 2 GO). Nothing new to fix.
Prior findings
- R1.1 (Should fix, CHANGELOG sentence): moot. The repo rule is that a pull request does not edit CHANGELOG.md, and the delta drops the hunk (
git diff --stat origin/main...HEAD: datamove.go and datamove_test.go only). The sentence it fixed is gone from the PR, so nothing in it is left to be wrong. - R1.2 (Question, id collision skipped without an error): unchanged, ticketed, does not block.
The merge of main
git show --remerge-diff a1f024b7ais empty: a clean merge, no conflict resolution.- The PR's own change over its merge base, before (
git diff 1029b8d34 b7bf24204) and after (git diff fca02d5cc ba8f2c20f): the+/-lines differ in exactly two places. The CHANGELOG hunk is gone, andgivenBackHere(datamove_test.go) now releases throughStreamTrunks.InGroupandTrunkGroupTx.ReleaseNumberinstead ofPhoneNumbers.Release. The three datamove.go hunks (the conflict term, and theboughtHeredoc and body) and both tests are the same. - The release path is the one the store's own
giveBackhelper (phone_number_test.go:12) uses.ReleaseNumberwith a zero time stampsnow, asReleasedid (phone_number.go:470). - Nit, no block:
giveBack(s.ctx, s.destination, "other", e164, time.Time{})already exists in the package and would replace the inline closure ingivenBackHere. Fix in this PR if you touch it again; not worth a round.
Checks
- I merged ba8f2c2 onto the current origin/main cd3f737 in a scratch worktree (clean).
go build ./...,go vet -tags integration ./...andgofmt -l internal/storeare clean.go test -tags integration ./internal/store/ -run TestDataMoveSuite -count=1 -p 1passes (91s, own database). - Mutation: restore
released_at IS NULLinboughtHere.TestANumberGivenBackHereIsNotWrittenOverByARowWithItsIDandTestAReplayedDeleteLeavesANumberGivenBackHereboth FAIL; the two held-number controls still pass. Restored. - CI: the PR is a draft, so
goandintegrationare skipping; CodeQL, Analyze (go, python, actions), labeler and GitGuardian pass.
Problem
A data move protects a phone number bought here only while it is still held:
boughtHerealso asks forreleased_at IS NULL(acceleration/internal/store/datamove.go). A number given back here is billing history. An importedsip_trunkrow with its id turned it into a live trunk number, and a replayed delete of that id removed it. Billing skips trunk numbers, so a month that began before the release was never billed.Found in the post-merge review of #2182 (R1.1).
Fix
boughtHereis nowvendor <> 'sip_trunk': every number bought here is guarded, held or given back. Both callers already use it, the import conflict clause and the replayed delete.Tests
Two new
DataMoveSuitetests, each on a number bought here and then given back:TestANumberGivenBackHereIsNotWrittenOverByARowWithItsID: an importedsip_trunkrow with its id, byImportRowand by a replayed update; the row stays released on its vendor.TestAReplayedDeleteLeavesANumberGivenBackHere: the row stays.Both fail on base 1029b8d and pass here. Mutations checked: restoring the
released_atterm, dropping the guard at the import site, dropping it at the delete site, inverting the vendor test, and a never-true guard each fail at least one test.🤖 Generated with Claude Code