From c9de5cc49a66c88e9f42da48e9f91107aafdf689 Mon Sep 17 00:00:00 2001 From: guanbinrui <52657989+guanbinrui@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:04:37 +0800 Subject: [PATCH] [Release] Hotfix 2.19.0 => 2.19.1 (patch) (#9388) * chore: bump version to 2.19.0 * fix: ignore internal error * fix: filter more invalid idents (#9393) * fix: mf-4020 can't use :has(), some users still use chrome<105 (#9392) --------- Co-authored-by: Jack Works Co-authored-by: UncleBill --- package.json | 2 +- packages/base/src/Identifier/profile.ts | 8 +++++--- packages/mask/src/manifest.json | 2 +- .../twitter.com/injection/Lens/injectLensOnPost.tsx | 4 +++- packages/web3-providers/src/Sentry/index.ts | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 263eefbf7dfc..f7fd0ec63e45 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "yarn": ">=999.0.0", "npm": ">=999.0.0" }, - "version": "2.19.0", + "version": "2.19.1", "private": true, "license": "AGPL-3.0-or-later", "scripts": { diff --git a/packages/base/src/Identifier/profile.ts b/packages/base/src/Identifier/profile.ts index bd1108fc90b5..3b9021f16a8b 100644 --- a/packages/base/src/Identifier/profile.ts +++ b/packages/base/src/Identifier/profile.ts @@ -18,6 +18,8 @@ export class ProfileIdentifier extends Identifier { static of(network: string | undefined | null, userID: string | undefined | null): Option { if (!userID || !network) return None if (network === 'localhost' && userID === '$unknown') return None + if (network.includes('/') || userID.includes('/')) return None + if (network.includes('\n') || userID.includes('\n')) return None return Some(new ProfileIdentifier(network, userID)) } @@ -25,12 +27,12 @@ export class ProfileIdentifier extends Identifier { declare readonly network: string declare readonly userId: string private constructor(network: string, userID: string) { + network = String(network).toLowerCase() + userID = String(userID) + if (network === 'localhost' && userID === '$unknown') { throw new TypeError('[@masknet/base] Use null instead.') } - - network = String(network).toLowerCase() - userID = String(userID) if (!userID) throw new TypeError('[@masknet/base] userID cannot be empty.') const networkCache = (id[network] ??= {}) diff --git a/packages/mask/src/manifest.json b/packages/mask/src/manifest.json index 969da0fdee16..fc802d407aa9 100644 --- a/packages/mask/src/manifest.json +++ b/packages/mask/src/manifest.json @@ -1,6 +1,6 @@ { "name": "Mask Network", - "version": "2.19.0", + "version": "2.19.1", "manifest_version": 2, "permissions": ["storage", "downloads", "webNavigation", "activeTab"], "optional_permissions": ["", "notifications", "clipboardRead"], diff --git a/packages/mask/src/social-network-adaptor/twitter.com/injection/Lens/injectLensOnPost.tsx b/packages/mask/src/social-network-adaptor/twitter.com/injection/Lens/injectLensOnPost.tsx index 3b35cf40233b..f66ab8e2cb6c 100644 --- a/packages/mask/src/social-network-adaptor/twitter.com/injection/Lens/injectLensOnPost.tsx +++ b/packages/mask/src/social-network-adaptor/twitter.com/injection/Lens/injectLensOnPost.tsx @@ -8,7 +8,9 @@ import { startWatch } from '../../../../utils/watcher.js' import { querySelectorAll } from '../../utils/selector.js' const selector = () => { - return querySelectorAll('[data-testid=User-Name] div :has(a[role=link]:not([tabindex]))') + return querySelectorAll('[data-testid=User-Name] div').filter((node) => { + return node.firstElementChild?.matches('a[role=link]:not([tabindex])') + }) } // structure: diff --git a/packages/web3-providers/src/Sentry/index.ts b/packages/web3-providers/src/Sentry/index.ts index 37b0f1959968..f6766ec956e8 100644 --- a/packages/web3-providers/src/Sentry/index.ts +++ b/packages/web3-providers/src/Sentry/index.ts @@ -22,8 +22,8 @@ const IGNORE_ERRORS = [ "Cannot perform 'getPrototypeOf' on a proxy that has been revoked", 'UnknownError: The databases() promise was rejected.', 'DataError: Failed to read large IndexedDB value', - "Failed to execute 'open' on 'CacheStorage': Unexpected internal error.", - 'UnknownError: Internal error opening backing store for indexedDB.open.', + 'Unexpected internal error', + 'UnknownError: Internal error', 'TimeoutError: Transaction timed out due to inactivity.', 'execution reverted', 'Failed to fetch',