fix(ldap): keep trusted baseline after rejected fetch (#6936)

The auto-delete retention guard refused a partial directory result for one tick, but still stored it as the next baseline, so the following tick detached clients that were still in LDAP. A refused fetch now leaves the baseline unchanged. Closes #6935.
This commit is contained in:
25f2002654
2026-11-02 19:40:28 +05:30
committed by GitHub
parent 34a762f7c8
commit ce44d2e772
3 changed files with 277 additions and 12 deletions
@@ -24,7 +24,7 @@ func TestAutoDeleteAllowed(t *testing.T) {
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
j := NewLdapSyncJob()
j.lastFlagCount.Store(c.previous)
j.lastTrustedFlagCount.Store(c.previous)
if got := j.autoDeleteSafeForFetch(c.fetched); got != c.want {
t.Fatalf("autoDeleteSafeForFetch(previous=%d, fetched=%d) = %v, want %v",
c.previous, c.fetched, got, c.want)