10 lines
1.4 KiB
Markdown
10 lines
1.4 KiB
Markdown
# PWA push receiver
|
|
|
|
The custom `src/main/frontend/sw.ts` retains the generated Vaadin worker's offline fallback, runtime-resource precache and connection-state reporting. Its push handlers are replaced by the tested `push-worker.js` module. This follows Vaadin's [custom service worker mechanism](https://vaadin.com/docs/latest/flow/configuration/pwa).
|
|
|
|
Incoming notifications use the journal icon and a stable per-day tag. Clicking closes the notification and navigates an existing application window to the dated Work form, or opens a new window when necessary. Destinations must match the application's origin and scope, the Work route, a real ISO date and `new=true`; external URLs, fragments and invalid dates are rejected. Malformed payloads do not cause an uncaught JSON error. Push event completion waits for notification display.
|
|
|
|
Frontend tests cover display, invalid payloads and URLs, scope-relative routing, and reuse/new-window behavior. The production build forces frontend generation because Vaadin's optimized reuse initially retained the default worker despite the custom source. The production smoke test now requests `/sw.js` and verifies that the application-specific receiver was actually packaged and served.
|
|
|
|
This prepares receipt and clicks. Browser opt-in, real device delivery and return to a dated form after a fresh login remain acceptance/integration work.
|