Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Push registration evaluation errors and improve Brave UX #1947

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion components/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,10 @@ export function NotificationAlert () {
error
? (
<Alert variant='danger' dismissible onClose={() => setError(null)}>
<span>{error.toString()}</span>
<span>{navigator?.brave && error.name === 'AbortError'
? 'Push registration failed. Enable "Use Google services for push messaging" in Brave\'s privacy settings and try again.'
: error.toString()}
</span>
</Alert>
)
: showAlert
Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ module.exports = withPlausibleProxy()({
'process.env.NEXT_PUBLIC_NORMAL_POLL_INTERVAL': JSON.stringify(process.env.NEXT_PUBLIC_NORMAL_POLL_INTERVAL),
'process.env.NEXT_PUBLIC_LONG_POLL_INTERVAL': JSON.stringify(process.env.NEXT_PUBLIC_LONG_POLL_INTERVAL),
'process.env.NEXT_PUBLIC_EXTRA_LONG_POLL_INTERVAL': JSON.stringify(process.env.NEXT_PUBLIC_EXTRA_LONG_POLL_INTERVAL),
'process.env.SANCTIONED_COUNTRY_CODES': JSON.stringify(process.env.SANCTIONED_COUNTRY_CODES),
'process.env.NEXT_IS_EXPORT_WORKER': 'true'
})
]
Expand Down
4 changes: 0 additions & 4 deletions sw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ self.addEventListener('install', () => self.skipWaiting())
// Also, the offline fallback only works if request matched a route
setDefaultHandler(new NetworkOnly({
plugins: [{
fetchDidFail: async (args) => {
// tell us why a request failed in dev
process.env.NODE_ENV !== 'production' && console.log('fetch did fail', ...args)
},
fetchDidSucceed: async ({ request, response, event, state }) => {
if (
response.ok &&
Expand Down
Loading