Delete Mesh Mint Bridge Token

24 views
Skip to first unread message

Chris Byrd

unread,
Jul 28, 2026, 12:31:27 AM (7 days ago) Jul 28
to Open Source CAD
Is there a way to delete a Mint Bridge Token?   I have been working trying to set this up but need to delete test tokens.

Thanks
Chris

Eric Osterberg

unread,
Jul 28, 2026, 11:25:12 AM (6 days ago) Jul 28
to open-so...@googlegroups.com
Chris,

Short answer: the API supports it, but the GUI wasn't built so a user could delete them. I've just built it.

You had found a real hole. Two of them, actually:

The console has always been able to revoke a bridge token - the code
was there and worked - but nothing in the page ever called it. The
bridge card would happily show you a token as "revoked" in red while
giving you no button that could ever put it in that state. So the one
thing the screen could do about a token was invisible.

And deleting a bridge outright was listed in our own developer notes
as a supported action, but it had never actually been written. Anyone
who went looking for it got an error.

What's on main now

Each bridge on the Mesh Bridges console has two buttons:

Revoke token - the token stops working immediately, and the bridge
stays in the list with its packet history. Use this if a token got out
somewhere it shouldn't have and you want to issue a fresh one.

Delete - the bridge disappears from the list and its token stops
working. This is the one you want for the test bridges you made while
setting up. Any packets it already received are kept, so your history
stays intact.

Both ask for confirmation first, so a stray click can't quietly kill a
bridge that's actually in service.

To pick it up

  git pull
  php sql/run_migrations.php

Then reload the Mesh Bridges page. The migration only adds two columns
and an index, and it's safe to run more than once.

One thing worth knowing while you're still setting up: revoke and
delete are deliberately different, and it's the difference between
"this credential is burned" and "this bridge was never real." For test
tokens you want Delete. For a bridge you'll keep using, Revoke and
then mint a fresh token for it.

Thanks for asking - a question like this is usually the fastest way we
find out something is missing. If anything else about the Meshtastic
setup feels like it should be there and isn't, say so.

Eric

--
You received this message because you are subscribed to the Google Groups "Open Source CAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-source-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/open-source-cad/6fb063b3-f25c-4812-a563-26fd47c08297n%40googlegroups.com.

Chris Byrd

unread,
Jul 28, 2026, 2:11:27 PM (6 days ago) Jul 28
to Open Source CAD
Eric,  Thanks for the update.    I did the git pull and got everything updated.    When you do a delete you get a JSON error in red at the top.  
Request Failed: Failed to execute 'json' on 'Response'; Unexpected end of JSON input.   The error goes away and the key does delete but I am not sure if something is still hanging around.

Chris
Screenshot 2026-07-28 130911.png

Eric Osterberg

unread,
Jul 29, 2026, 4:36:00 PM (5 days ago) Jul 29
to open-so...@googlegroups.com
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.


To pick it up

  git pull

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

Chris Byrd

unread,
Jul 29, 2026, 9:26:39 PM (5 days ago) Jul 29
to Open Source CAD
Eric,  After doing the git pull i got the following warning.
I just ran the php sql/run_migrations.php as it asked but thought you might want to know it asked.
Screenshot 2026-07-29 202205.png
Chris

Eric Osterberg

unread,
Jul 29, 2026, 9:38:56 PM (5 days ago) Jul 29
to open-so...@googlegroups.com
That's exactly how it's designed to work. It tells you a command is needed, you run it, and then it's ready to go.

Chris Byrd

unread,
Jul 29, 2026, 9:40:10 PM (5 days ago) Jul 29
to Open Source CAD
Ok.  Another one on the mesh token.     If I create a token -> revoke the token -> delete the token I get a delete failed.

Screenshot 2026-07-29 203801.png

Yes,  I know..  I break software....

Thanks
Chris
Reply all
Reply to author
Forward
0 new messages