Grey the toolbar icon while the testing switch is on or Postulo cannot be reached #4
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The toolbar icon never changes: the only action calls in
srcset the badge (showUnsentCount(),src/lib/local.js:30-35). Nor does the extension know whether Postulo answers unless it is sending: with nothing waiting,deliver()returnsnothingbefore reading the settings or contacting anything (src/lib/outbox.js:32-37), andlastDelivery(src/lib/local.js:24-26) is written and never read. This issue greys the icon while the testing switch is on or Postulo cannot be reached, and owns the connection state that #5 and #9 also read.“Working offline” is read as the testing switch, the code's
offline; a real failure is the outcomeunreachable. Read as the device having no network, that fails like an unreachable Postulo: grey either way.What the extension should do
onStartupandonInstalled, wheninstance,tokenorofflinechange, and when the host permission is granted or withdrawn (permissions.onAdded,onRemoved); and from the outcome ofPOST /captures,POST /captures/known, and Test'sGET /mewhen it tested the saved address and token (it takes what is typed:src/options.js:94-106). No check is made in testing (nothing may be sent), when not set up, or without the permission.tabId) and set again atonStartupandonInstalled, as the badge is: browsers forget action changes on restart. Grey, not disabled: a disabled action opens no popup, and capturing must work with Postulo away.src/style.css:450):action.setTitlegives the reason, then the button's title (actionTitle).notConnected,offlineOn,noPermissionandtokenRefusedexist;waitingis about one capture just sent, so unreachable needs a new sentence, for example “Postulo cannot be reached: what you send waits in this browser until it answers.”Decisions for this repository
/healthzanswering 503). Proposed too: not set up, since nothing reaches Postulo; token refused (401 or 403) and host permission missing, since nothing is sent or accepted until the settings are fixed. The alternative: these three in colour, said only in the popup. A 429 means Postulo answered, so reachable;deliver()reports it asunreachabletoday (kindOfFailure()), so the record goes by the status code. Recommended: grey for all five; not for a 429.GET /healthzis public, needs no token, is neither throttled nor cached, costs about one query and answers 503 when the database is down (the core'ssrc/postulo/core/views.py), but proves nothing about the token.GET /api/v1/meproves it but spends one of the token's 600 calls an hour (the default), shared with captures. Recommended:/healthz, with no token and no cookies; the token's state from the last real call that carried it (a token revoked since shows at the next send), andGET /me, checking forcapturesas Test does, only when that is unknown, after saving. A 4xx from/healthz(a proxy blocking it) means the host answered: fall back toGET /me.scripts/icons.py, which would desaturate what the core'srendered()draws, committed and switched withsetIcon({path}); or drawn at run time withOffscreenCanvasand agrayscale(1)filter, available in both backgrounds. Recommended:icons.py: no drawing code, the same pixels in both browsers. Check it on a dark toolbar too.lastDelivery: kept, or replaced by the record. Recommended: replaced.The browser behaviour here is documented (Chrome, MDN), not tried in a real browser. Chrome keeps the icon in its extensions menu until pinned. Where Firefox puts the button, and the title doubling as the menu label on Firefox for Android: postulo/postulo-firefox#3.
Needs from the server
Nothing:
/healthzandGET /meexist. Not filed on postulo/postulo.Documents and translations
PRIVACY.mdsays “exactly three” requests. A periodicGET /healthzis a fourth: no token and nothing of the person's, though it tells their server the browser is running, and from where; “Nothing is ever sent that you did not press Send on” must name it as the exception.GET /meafter saving extends the Test row. The list of what is kept, and the date, change too.README.md: the layout table'ssrc/background.jsrow, andsrc/icons/if grey icons are committed.test/i18n.test.mjsrequires every new key in all 40_localesat once, with identical placeholders: each new sentence costs 40 translations in the same commit.Done when
node --test, liketest/outbox.test.mjs.PRIVACY.mdandREADME.mddescribe the new behaviour.From the list of extension improvements of 2026-09-30.