The harder-to-refactor parts are the places where exists/username/token
are called within a React component. However, `resetAndRedirect` and
`store` are already called from async contexts, so adding an `await`
is simple.
This thus merges the logic, keeping localStorage for the components to
call, but making sure reset/store behaviour works correctly for the
replica.
- Use a single endpoint
- Use a declarative web push sync hook. This thus handles all edge cases
that had to be manually handled before: logout, login, account sync,
etc.
- Simplify UX: browser notifications are always enabled (unless denied),
web push toggle only shows up if permissions are already granted.
- Use new notification request/opt-in flow for push
- Implement unsubscribing
- Implement muting
- Implement emojis in title
- Add iOS specific PWA warning
- Don’t use websockets when web push is enabled
- Fix duplicate notifications
- Implement default web push setting
- Implement changing subscription type
- Implement web push subscription refresh
- Implement web push notification click
I’d like to test #751 on my own instance, but installing all the build
dependencies on my server isn’t ideal - having this script in the repo
would make it possible to simply point my compose file to the git repo
and have it build the Linux binary itself.
Note that it uses a somewhat “inefficient” builder step, i.e. not
combining steps together to reduce layers, as it uses a multi-stage
build to have a lean final image. This makes it easier to re-build if
something needs to change, as the cache is used more optimally.
For example, if only some go files change, most of the build is already
cached and only the go step gets re-run.
The more “efficient” builder step would look like this, but would have
to build the docs, web app and go CLI for any change in any file:
```Dockerfile
FROM golang:1.19-bullseye as builder
RUN apt-get update && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash && \
apt-get install -y \
build-essential \
nodejs \
python3-pip
WORKDIR /app
ADD . .
RUN make web docs cli-linux-server
```
`apt` is for interactive shell usage, using it in a script results in a
warning as the CLI interface is not stable
> WARNING: apt does not have a stable CLI interface.
> Use with caution in scripts.
These are safe fixes, more complicated fixes can be done separately
(just disabled those errors for now).
- Reorder declarations to fix `no-use-before-define`
- Rename parameters for `no-shadow`
- Remove unused parameters, functions, imports
- Switch from `++` and `—` to `+= 1` and `-= 1` for `no-unary`
- Use object spreading instead of parameter reassignment in auth utils
- Use `window.location` instead of `location` global
- Use inline JSX strings instead of unescaped values
-
- Use the newest versions to solve the deprecation warning
- Remove the cache step as the newest go and node actions have built-in
caching
- Add the official actions@github.com email address