Repository navigation
v0.31.1
The auth starter shows a form's toast once. A change to an account that notifies, as turning two-factor logins off or making an API token does, rings the bell in the header, which reloads its count as the notification's event comes. When the event came as the form's visit was still loading the page it goes back to, the two requests ran at once, as Inertia's reloads are async, both read the session with the flash the form left, and the page showed it twice: two toasts of "Two-factor logins are off.", as a run of the browser suite caught. listen, in the starter's resources/js/lib/broadcasts.ts, which the bell, the notifications' page and the verify page share, now holds their reloads while a request of Inertia's is in flight, counted from the inertia:start and inertia:finish events it fires on the document for each, and runs each once the last finishes. The flash couldn't be kept from the reload on the server: the two requests carry one cookie.
Upgrading: tug's Go is as it was, so go get github.com/cuonggt/tug@v0.31.1 changes nothing in an app. The fix is in the auth starter's frontend, the same file in React, Vue and Svelte: an app made with tug new -auth from v0.31.1, go install github.com/cuonggt/tug/cmd/tug@v0.31.1, has it, and one made before takes its resources/js/lib/broadcasts.ts as it is.
The guide is in docs/. tug needs Go 1.26.