Sw dev fix #3
Open
nathan
wants to merge 20 commits from
sw-fix into lotus
pull from: sw-fix
merge into: :lotus
:lotus
:update-packages
:sw-fix
:read-me-update
:image-path-changes
:dm-calls
:fix-2469
:renovate/element-hq-element-call-embedded-0.x
:renovate/npm-i18next-http-backend-vulnerability
:renovate/npm-vite-vulnerability
:dev
:docs-update
:more-theme
:fix-257
:imporve-thread-reply
:revert-2402-improve-menu-congestion
:mxidColor-toggle
:update-sw-main-msg
Labels
Clear labels
a11y
area: appearance
area: auth-session
area: build-ci
area: calls
area: desktop
area: media
area: messaging
area: mobile
area: moderation
area: navigation
area: notifications
area: settings
area: threads
bug
dependencies
docs
duplicate
enhancement
help wanted
invalid
needs-human-review
performance
planning
priority: critical
priority: high
priority: low
priority: medium
qa
question
research
security
tech-debt
ux
wontfix
Accessibility: keyboard, screen reader, contrast, motion
Client area: appearance
Client area: auth-session
Client area: build-ci
Client area: calls
Client area: desktop
Client area: media
Client area: messaging
Client area: mobile
Client area: moderation
Client area: navigation
Client area: notifications
Client area: settings
Client area: threads
Something is not working
Third-party package versions and advisories
README / LOTUS_* docs wrong or missing
This issue or pull request already exists
New feature
Need some help
Something is wrong
Re-render storms, leaks, heavy work on hot paths
Data loss, security hole, or crash on a main path
Broken feature or serious usability problem
Minor issue or polish
Wrong behaviour in an edge case or notable degradation
Manual QA: shipped, needs a human in a real environment
More information is needed
XSS, unsafe URLs, data leaks, auth/session
Code health, dead code, fragile patterns
Usability or visual inconsistency
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LotusGuild/cinny#3
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixed service worker registration when running in a development environment
Re-reviewed at head
50bb5094. The core fix is right and worth landing — registering the dev SW with { type: 'module' } is correct (/dev-sw.js is an ES module under VitePWA's devOptions, so the oldregistration threw in dev), and the try/catch + logging is a nice touch. But npm run lint is currently red (8 eslint errors):
Remove import { register } from 'module'; (src/index.tsx). It's Node's built-in module pulled into a browser bundle, and it's unused — you call your own registerServiceWorker. It's causing two of the
errors (@typescript-eslint/no-unused-vars + import/order). Deleting it also removes the need for the /* eslint-disable import/first */ you added at the top — please drop that disable and fix the placement
rather than silencing the rule.
void registerServiceWorker(); trips no-void. Call it directly (the function already has its own try/catch) or handle the promise with .catch(...).
Rebase onto current lotus. This branch is stacked on the image-path commit, so it also carries that change — the root-URL prod-404 from #1 plus import/newline-after-import on the logo consts. Rebasing
drops all of that and leaves this PR as just the SW fix.
Once it's only the SW-registration change on a clean base with npm run lint + npx tsc --noEmit green, this is a clear merge. 👍
Claude Sonnet 5 btw
The SW fix itself is in good shape now — the stray import { register } from 'module' is gone, no-void is resolved, and the { type: 'module' } dev registration is correct. That part's a clean merge. 👍
The problem is scope: this PR has grown to 31 files and bundles several unrelated changes, two of which can't ship:
code passes CI and deploys. Please drop this; formatting is already handled by the pre-commit hook on lotus, and the ci.yml here also conflicts with lotus.
f2c356f2, using /public/res/ — verified prod-safe) and 404s in prod as written. It's what's blocking the merge.Suggested path: rebase onto current lotus and reduce this PR to just src/index.tsx (the SW fix). Open separate PRs for the eslint-policy change and any dependency bumps so each can be reviewed on its own.
The SW fix will merge cleanly once it's standalone on a current base.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.