Chris,
Good catch, and thank you for describing it precisely - "the error goes away and the key does delete but I am not sure if something is still
hanging around" is exactly the detail that made it findable.
First, the reassurance: nothing was left hanging around. The delete fully completed every time. The token was revoked, the bridge was
removed from the list, and the packet history was kept. What failed was only the very last step - writing the entry to the audit log and
sending the "success" reply back to your browser.
What happened, if you are curious
The audit log call had its arguments in the wrong order. One of them was supposed to be a short description and I passed it a block of data
instead. In PHP 8 that is a hard error rather than a warning, and it was a kind of error the surrounding safety net was not set up to catch.
Our pages deliberately turn off error display so a stray warning cannot corrupt the data the page is reading. The side effect here was that
instead of an error message you got nothing at all - an empty reply.
Your browser tried to read that empty reply as data and told you "Unexpected end of JSON input."
So the sequence was: delete works, delete works, delete works, then the logging line fails and takes the reply down with it. Which is why you
saw a red error on top of a delete that had actually succeeded.
What I changed
Three things, not one:
The argument order is corrected, so the audit entry now records properly. Your deletes were never being logged; from now on they will
be.
The safety net around that code now catches this whole class of error, so if anything similar ever happens there you will get a real error
message instead of a blank one.
I added an automated check that scans every audit log call in the codebase for this same mistake. It checked 386 of them and yours was
the only one, which at least means the problem was confined to the new delete feature rather than something older and wider.
That is all - no migration needed this time.
One more thing worth mentioning: your report also pointed at a bigger pattern. That "empty reply" failure can happen anywhere the same way,
and it always looks like this same confusing JSON error. I am working through the rest of the code now so that any unexpected failure returns
a readable message instead of a blank. So this one turned into a genuinely useful find well beyond the delete button.
Thanks again - keep them coming.
Eric