diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-03 21:21:33 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-03 21:41:19 +0000 |
| commit | d392f0bc14bcd687e918d4653ae016226496b4c4 (patch) | |
| tree | 2738b66be231c90615b15d2da1266e16704c510d /src/git/handlers.rs | |
| parent | c163d717147b92b16d89da2fbccef775647b5a07 (diff) | |
feat: add diagnostic logging for partial state event matches
Improves observability when pushes are rejected due to state events that
only partially match the pushed refs. Previously, logs only showed 'No
state event found' even when state events existed but didn't match.
Changes:
- Add diagnose_state_mismatch() to explain why state events don't match
- Log specific reasons: missing refs, wrong SHAs, or extra refs
- Update rejection message to 'No matching state event found' (more accurate)
- Add 4 unit tests for diagnostic function
Example diagnostic output:
WARN State event abc123 from authorized author doesn't match push:
refs/heads/main missing (state declares 9cc3d93b)
This addresses the issue where a push with only refs/heads/test was
rejected because the state event also declared refs/heads/main, but
logs didn't explain why the match failed.
Diffstat (limited to 'src/git/handlers.rs')
| -rw-r--r-- | src/git/handlers.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/git/handlers.rs b/src/git/handlers.rs index e3a6ad4..7244abb 100644 --- a/src/git/handlers.rs +++ b/src/git/handlers.rs | |||
| @@ -254,7 +254,7 @@ pub async fn handle_receive_pack( | |||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | // GRASP Authorization Check | 256 | // GRASP Authorization Check |
| 257 | info!( | 257 | debug!( |
| 258 | "Authorizing push for {} owned by {} via database query", | 258 | "Authorizing push for {} owned by {} via database query", |
| 259 | identifier, owner_pubkey | 259 | identifier, owner_pubkey |
| 260 | ); | 260 | ); |