firebase updated, two bugs related to fb fixed

This commit is contained in:
or-else
2026-07-04 15:42:55 +03:00
parent d24b297685
commit 70a9ab8996
9 changed files with 1577 additions and 876 deletions
+333 -323
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -78,7 +78,7 @@
"author": "Tinode Authors <info@tinode.co>",
"license": "Apache-2.0",
"dependencies": {
"firebase": "^11.0.0",
"firebase": "^12.15.0",
"libphonenumber-js": "^1.10.40",
"qrcodejs": "^1.0.0",
"react": "^18.3.0",
@@ -105,7 +105,7 @@
"webpack-cli": "^7.0.0"
},
"allowScripts": {
"@firebase/util@1.12.1": true,
"@firebase/util@1.15.1": true,
"fsevents@2.3.3": true,
"protobufjs@7.6.5": true,
"unrs-resolver@1.12.2": true
+3 -1
View File
@@ -1,7 +1,9 @@
import { PACKAGE_VERSION } from './version.js';
// Version-independent name of this application, used for Firebase app name.
export const BASE_APP_NAME = 'TinodeWeb';
// Name of this application, used in the User-Agent.
export const APP_NAME = 'TinodeWeb/' + (PACKAGE_VERSION || '0.24');
export const APP_NAME = BASE_APP_NAME + '/' + (PACKAGE_VERSION || '0.25');
// API key. Use https://github.com/tinode/chat/tree/master/keygen to generate your own
export const API_KEY = 'AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K';
+8 -5
View File
@@ -18,7 +18,7 @@ const InfoView = React.lazy(_ => import('./info-view.jsx'));
const MessagesView = React.lazy(_ => import('./messages-view.jsx'));
import SidepanelView from './sidepanel-view.jsx';
import { API_KEY, APP_NAME, DEFAULT_COLOR_SCHEME, DEFAULT_P2P_ACCESS_MODE, DEFAULT_TEXT_SIZE, FORWARDED_PREVIEW_LENGTH,
import { API_KEY, APP_NAME, BASE_APP_NAME, DEFAULT_COLOR_SCHEME, DEFAULT_P2P_ACCESS_MODE, DEFAULT_TEXT_SIZE, FORWARDED_PREVIEW_LENGTH,
LOGGING_ENABLED, MEDIA_BREAKPOINT, WAKE_UP_TICK, WAKE_UP_TIMEOUT } from '../config.js';
import { CALL_STATE_NONE, CALL_STATE_OUTGOING_INITATED,
CALL_STATE_INCOMING_RECEIVED, CALL_STATE_IN_PROGRESS,
@@ -441,7 +441,7 @@ class TinodeWeb extends React.Component {
}
try {
this.fcm = firebaseGetMessaging(firebaseInitApp(FIREBASE_INIT, APP_NAME));
this.fcm = firebaseGetMessaging(firebaseInitApp(FIREBASE_INIT, BASE_APP_NAME));
return navigator.serviceWorker.getRegistration('/service-worker.js').then(reg => {
return reg || navigator.serviceWorker.register('/service-worker.js').then(reg => {
this.checkForAppUpdate(reg);
@@ -493,7 +493,7 @@ class TinodeWeb extends React.Component {
return Notification.requestPermission().then(permission => {
if (permission === 'granted') {
return firebaseGetToken(fcm, {
serviceWorkerRegistration: reg,
serviceWorkerRegistration: sw,
vapidKey: FIREBASE_INIT.messagingVapidKey
}).then(token => {
if (token) {
@@ -1604,8 +1604,11 @@ class TinodeWeb extends React.Component {
localStorage.removeItem('auth-token');
localStorage.removeItem('firebase-token');
localStorage.removeItem('settings');
if (this.state.firebaseToken) {
firebaseDelToken(this.fcm);
if (this.state.firebaseToken && this.fcm) {
// Unsubscribe failures (e.g. 403 token-unsubscribe-failed) should not block logout.
firebaseDelToken(this.fcm).catch(err => {
console.warn('Failed to delete FCM token on logout', err);
});
}
// Reset color scheme.
+1211 -542
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+17
View File
@@ -117,6 +117,23 @@
* limitations under the License.
*/
/**
* @license
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @license React
* react-jsx-runtime.production.min.js
File diff suppressed because one or more lines are too long