Skip to content

Commit 9cb401b

Browse files
guanbinruileleneiUncleBill
authored
[Release] Hotfix 2.21.2 => 2.21.3 (patch) (#9933)
* chore: bump version 2.21.3 * refactor: wc v1 bridge url (#9934) * refactor: update bridge url * refactor: deactive remote flags * refactor: enable remote config * fix: sentry tx reports (#10062) * chore: add logs * refactor: update comment * chore: remove dev guard * Revert "chore: remove dev guard" This reverts commit 89eb425. * Revert "chore: add logs" This reverts commit d29021e. * fix: all tx should be recorded * fix: relation service query (#10096) * fix: mf-4561 click on shadowdom cause ui jumping (#10114) * fix: mf-4448 some nft have been filtered out (#10112) * fixup! fix: mf-4561 click on shadowdom cause ui jumping (#10114) (#10125) * fix: relation service (#10138) * fix: relation service * refactor: reply review * fix: twitter api (#10139) * fix: relation service (#10141) --------- Co-authored-by: lelenei <[email protected]> Co-authored-by: UncleBill <[email protected]>
1 parent b010c54 commit 9cb401b

File tree

15 files changed

+310
-227
lines changed

15 files changed

+310
-227
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"yarn": ">=999.0.0",
99
"npm": ">=999.0.0"
1010
},
11-
"version": "2.21.2",
11+
"version": "2.21.3",
1212
"private": true,
1313
"license": "AGPL-3.0-or-later",
1414
"scripts": {

packages/flags/src/flags/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const flags = {
4949
sentry_async_transaction_enabled: devOnly,
5050

5151
// wallet connect
52-
wc_v1_bridge_url: 'https://bridge.walletconnect.org',
52+
wc_v1_bridge_url: 'https://wc.firefly.land',
5353
wc_v2_relay_url: 'wss://relay.walletconnect.com',
5454
wc_v2_project_id: '8f1769933420afe8873860925fcca14f',
5555
wc_v2_mode: process.env.NODE_ENV === 'production' ? 'error' : 'debug',

packages/mask/src/components/GuideStep/index.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,20 @@ export default function GuideStep({ total, step, tip, children, arrow = true, on
138138

139139
useLayoutEffect(() => {
140140
let stopped = false
141-
requestAnimationFrame(function self() {
141+
requestAnimationFrame(function fn() {
142142
if (stopped) return
143-
requestAnimationFrame(self)
143+
requestAnimationFrame(fn)
144144
if (!childrenRef.current) return
145145
const cr = childrenRef.current.getBoundingClientRect()
146146
if (!cr.height) return
147147
const bottomAvailable = window.innerHeight - cr.height - cr.top > 200
148148
setBottomAvailable(bottomAvailable)
149-
let update = false
150149
setClientRect((old) => {
151150
if (
152151
old &&
153152
(old.height === cr.height || old.left === cr.left || old.top === cr.top || old.width === cr.width)
154153
)
155154
return old
156-
update = true
157155
return cr
158156
})
159157
if (box1Ref.current) {

packages/mask/src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Mask Network",
3-
"version": "2.21.2",
3+
"version": "2.21.3",
44
"manifest_version": 2,
55
"permissions": ["storage", "downloads", "webNavigation", "activeTab"],
66
"optional_permissions": ["<all_urls>", "notifications", "clipboardRead"],

packages/mask/src/social-network-adaptor/twitter.com/injection/ProfileTab.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export function injectProfileTabAtTwitter(signal: AbortSignal) {
263263
name: 'Last tab in the profile page',
264264
rule: isProfilePageLike,
265265
},
266+
shadowRootDelegatesFocus: false,
266267
})
267268
attachReactTreeWithContainer(watcher.firstDOMProxy.afterShadow, { signal }).render(
268269
<>
@@ -277,5 +278,6 @@ export function injectProfileTabAtTwitter(signal: AbortSignal) {
277278
startWatch(contentWatcher, {
278279
signal,
279280
missingReportRule: { name: 'ProfileTab', rule: isProfilePageLike },
281+
shadowRootDelegatesFocus: false,
280282
})
281283
}

packages/mask/src/social-network-adaptor/twitter.com/injection/ProfileTabContent.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import {
1111

1212
function injectProfileTabContentForEmptyState(signal: AbortSignal) {
1313
const watcher = new MutationObserverWatcher(searchProfileEmptySelector())
14-
startWatch(watcher, signal)
14+
startWatch(watcher, { signal, shadowRootDelegatesFocus: false })
1515
attachReactTreeWithContainer(watcher.firstDOMProxy.afterShadow, { signal }).render(
1616
<ProfileTabContentAtTwitter floating />,
1717
)
1818
}
1919

2020
function injectProfileTabContentState(signal: AbortSignal) {
2121
const watcher = new MutationObserverWatcher(searchProfileTabPageSelector())
22-
startWatch(watcher, signal)
22+
startWatch(watcher, { signal, shadowRootDelegatesFocus: false })
2323
attachReactTreeWithContainer(watcher.firstDOMProxy.afterShadow, { signal }).render(<ProfileTabContentAtTwitter />)
2424
}
2525

@@ -36,9 +36,9 @@ export function injectProfileTabContentAtTwitter(signal: AbortSignal) {
3636
MaskMessages.events.profileTabHidden.sendToLocal({ hidden: false }),
3737
)
3838

39-
startWatch(contentLoseConnectionWatcher, signal)
40-
startWatch(contentContentWatcher, signal)
41-
startWatch(ContentForEmptyWatcher, signal)
39+
startWatch(contentLoseConnectionWatcher, { signal, shadowRootDelegatesFocus: false })
40+
startWatch(contentContentWatcher, { signal, shadowRootDelegatesFocus: false })
41+
startWatch(ContentForEmptyWatcher, { signal, shadowRootDelegatesFocus: false })
4242

4343
injectProfileTabContentForEmptyState(signal)
4444
injectProfileTabContentState(signal)

packages/mask/src/utils/watcher.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function startWatch<T extends MutationObserverWatcher<any, any, any, any>
2222
if (options instanceof AbortSignal) {
2323
options = { signal: options }
2424
}
25-
const { signal, missingReportRule } = options
25+
const { signal, missingReportRule, shadowRootDelegatesFocus: delegatesFocus } = options
2626

2727
if (missingReportRule) {
2828
watchers.set(watcher, missingReportRule)
@@ -39,8 +39,8 @@ export function startWatch<T extends MutationObserverWatcher<any, any, any, any>
3939

4040
watcher
4141
.setDOMProxyOption({
42-
afterShadowRootInit: Flags.shadowRootInit,
43-
beforeShadowRootInit: Flags.shadowRootInit,
42+
afterShadowRootInit: { ...Flags.shadowRootInit, delegatesFocus },
43+
beforeShadowRootInit: { ...Flags.shadowRootInit, delegatesFocus },
4444
})
4545
.startWatch({ subtree: true, childList: true }, signal)
4646
return watcher
@@ -59,6 +59,7 @@ export interface MissingReportRuleOptions {
5959
export interface WatchOptions {
6060
signal: AbortSignal
6161
missingReportRule?: MissingReportRuleOptions
62+
shadowRootDelegatesFocus?: boolean
6263
}
6364

6465
const watchers = new Map<MutationObserverWatcher<any>, MissingReportRuleOptions>()

packages/shared-base/src/NextID/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface NextIDEnsRecord {
2626
category: 'ENS'
2727
chain: string
2828
id: string
29+
uuid: string
2930
}
3031

3132
export interface NextIDIdentity {

packages/theme/src/ShadowRoot/ShadowRootIsolation.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function ShadowRootIsolation({ children, rootElement = 'div', ...props }:
3131
if (dom.shadowRoot) return
3232

3333
// Note: ShadowRootIsolation is expected to use inside other closed ShadowRoot
34-
const shadow = dom.attachShadow({ ...Flags.shadowRootInit, mode: 'open' })
34+
const shadow = dom.attachShadow({ ...Flags.shadowRootInit, mode: 'open', delegatesFocus: false })
3535
shadow.appendChild(container.current!)
3636
}, [dom])
3737

packages/web3-providers/src/NextID/proof.ts

+78-41
Original file line numberDiff line numberDiff line change
@@ -26,54 +26,83 @@ const BASE_URL =
2626
process.env.channel === 'stable' && process.env.NODE_ENV === 'production' ? PROOF_BASE_URL_PROD : PROOF_BASE_URL_DEV
2727

2828
const relationServiceDomainQuery = `domain(domainSystem: $domainSystem, name: $domain) {
29+
source
30+
system
31+
name
32+
fetcher
33+
resolved {
34+
identity
35+
platform
36+
displayName
37+
}
38+
owner {
39+
identity
40+
platform
41+
displayName
42+
uuid
43+
nft(category: ["ENS"], limit: 100, offset: 0) {
44+
uuid
45+
category
46+
chain
47+
id
48+
}
49+
neighborWithTraversal(depth: 5) {
50+
... on ProofRecord {
2951
source
30-
system
31-
name
32-
fetcher
33-
resolved {
34-
identity
52+
from {
53+
nft(category: ["ENS"], limit: 100, offset: 0) {
54+
uuid
55+
category
56+
chain
57+
id
58+
}
59+
uuid
3560
platform
61+
identity
3662
displayName
3763
}
38-
owner {
64+
to {
65+
nft(category: ["ENS"], limit: 100, offset: 0) {
66+
uuid
67+
category
68+
chain
69+
id
70+
}
71+
uuid
72+
platform
3973
identity
74+
displayName
75+
}
76+
}
77+
... on HoldRecord {
78+
source
79+
from {
80+
nft(category: ["ENS"], limit: 100, offset: 0) {
81+
uuid
82+
category
83+
chain
84+
id
85+
}
86+
uuid
4087
platform
88+
identity
4189
displayName
42-
neighborWithTraversal(depth: 5) {
43-
... on ProofRecord {
44-
__typename
45-
source
46-
from {
47-
uuid
48-
platform
49-
identity
50-
displayName
51-
}
52-
to {
53-
uuid
54-
platform
55-
identity
56-
displayName
57-
}
58-
}
59-
... on HoldRecord {
60-
__typename
61-
source
62-
from {
63-
uuid
64-
platform
65-
identity
66-
displayName
67-
}
68-
to {
69-
uuid
70-
platform
71-
identity
72-
displayName
73-
}
74-
}
90+
}
91+
to {
92+
nft(category: ["ENS"], limit: 100, offset: 0) {
93+
uuid
94+
category
95+
chain
96+
id
7597
}
98+
uuid
99+
platform
100+
identity
101+
displayName
102+
}
76103
}
104+
}
105+
}
77106
}`
78107

79108
const relationServiceIdentityQuery = `
@@ -326,6 +355,7 @@ export class NextIDProofAPI implements NextIDBaseAPI.Proof {
326355
domain: {
327356
owner: {
328357
neighborWithTraversal: NeighborList
358+
nft: NextIDEnsRecord[]
329359
}
330360
} | null
331361
}
@@ -348,7 +378,7 @@ export class NextIDProofAPI implements NextIDBaseAPI.Proof {
348378
)
349379

350380
if (!data.domain) return EMPTY_LIST
351-
const bindings = createBindProofsFromNeighbor(data.domain.owner.neighborWithTraversal, [])
381+
const bindings = createBindProofsFromNeighbor(data.domain.owner.neighborWithTraversal, data.domain.owner.nft)
352382
return uniqWith(bindings, (a, b) => a.identity === b.identity && a.platform === b.platform).filter(
353383
(x) => ![NextIDPlatform.Ethereum, NextIDPlatform.NextID].includes(x.platform) && x.identity,
354384
)
@@ -412,7 +442,14 @@ export class NextIDProofAPI implements NextIDBaseAPI.Proof {
412442
{ enableSquash: true },
413443
)
414444

415-
const bindings = createBindProofsFromNeighbor(data.identity.neighborWithTraversal, data.identity.nft)
445+
const nft = uniqBy(
446+
data.identity.neighborWithTraversal
447+
.flatMap((x) => x.from.nft)
448+
.concat(data.identity.neighborWithTraversal.flatMap((x) => x.from.nft)),
449+
(x) => x.uuid,
450+
)
451+
452+
const bindings = createBindProofsFromNeighbor(data.identity.neighborWithTraversal, nft)
416453

417454
return uniqWith(bindings, (a, b) => a.identity === b.identity && a.platform === b.platform).filter(
418455
(x) => ![NextIDPlatform.Ethereum, NextIDPlatform.NextID].includes(x.platform) && x.identity,

packages/web3-providers/src/SimpleHash/apis/EVM.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import urlcat from 'urlcat'
2-
import { compact, uniqBy } from 'lodash-es'
2+
import { compact } from 'lodash-es'
33
import { MaskIconURLs } from '@masknet/icons'
44
import {
55
EMPTY_LIST,
@@ -42,7 +42,7 @@ import {
4242
resolveEventType,
4343
resolveSimpleHashRange,
4444
checkBlurToken,
45-
checkLensFollower,
45+
isLensFollower,
4646
} from '../helpers.js'
4747
import {
4848
type Asset,
@@ -287,16 +287,16 @@ export class SimpleHashAPI_EVM implements NonFungibleTokenAPI.Provider<ChainId,
287287

288288
const response = await fetchFromSimpleHash<{ collections: Collection[] }>(path)
289289

290-
const filteredCollections = uniqBy(response.collections, (x) => x.top_contracts?.[0])
290+
const filteredCollections = response.collections
291291
// Might got bad data responded including id field and other fields empty
292-
.filter(
293-
(x) =>
294-
x?.id &&
292+
.filter((x) => {
293+
if (!x?.id || x.spam_score === 100) return false
294+
return (
295295
isValidChainId(resolveChainId(x.chain)) &&
296-
x.spam_score !== 100 &&
297296
x.top_contracts.length > 0 &&
298-
(!checkLensFollower(x.name ?? '') || !isERC712Only),
299-
)
297+
(!isLensFollower(x.name) || !isERC712Only)
298+
)
299+
})
300300

301301
let erc721CollectionIdList: string[] = EMPTY_LIST
302302

packages/web3-providers/src/SimpleHash/helpers.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { isEmpty, memoize } from 'lodash-es'
2+
import { unreachable } from '@masknet/kit'
13
import {
24
SourceType,
35
TokenType,
@@ -8,15 +10,13 @@ import {
810
import { ChainId, SchemaType, WNATIVE, chainResolver, isValidChainId, resolveImageURL } from '@masknet/web3-shared-evm'
911
import { ChainId as SolanaChainId } from '@masknet/web3-shared-solana'
1012
import { ChainId as FlowChainId } from '@masknet/web3-shared-flow'
11-
import { isEmpty } from 'lodash-es'
1213
import { createPermalink } from '../NFTScan/helpers/EVM.js'
13-
import { fetchJSON, getAssetFullName } from '../entry-helpers.js'
14-
import { ETH_BLUR_TOKEN_ADDRESS, SIMPLE_HASH_URL } from './constants.js'
15-
import { ActivityType as ActivityTypeSimpleHash, type Asset, type Collection } from './type.js'
1614
import { NetworkPluginID, createLookupTableResolver, queryClient } from '@masknet/shared-base'
1715
import type { Web3Helper } from '@masknet/web3-helpers'
1816
import { TrendingAPI } from '../entry-types.js'
19-
import { unreachable } from '@masknet/kit'
17+
import { fetchJSON, getAssetFullName } from '../entry-helpers.js'
18+
import { ETH_BLUR_TOKEN_ADDRESS, SIMPLE_HASH_URL } from './constants.js'
19+
import { ActivityType as ActivityTypeSimpleHash, type Asset, type Collection } from './type.js'
2020

2121
export async function fetchFromSimpleHash<T>(path: string, init?: RequestInit) {
2222
return queryClient.fetchQuery<T>({
@@ -132,7 +132,9 @@ export function createNonFungibleCollection(collection: Collection): NonFungible
132132
}
133133
}
134134

135-
export function resolveChainId(chain: string): ChainId | undefined {
135+
export const resolveChainId: (chainId: string) => ChainId | undefined = memoize(function resolveChainId(
136+
chain: string,
137+
): ChainId | undefined {
136138
// Some of the `chainResolver.chainId()` results do not match.
137139
switch (chain) {
138140
case 'ethereum':
@@ -152,7 +154,7 @@ export function resolveChainId(chain: string): ChainId | undefined {
152154
default:
153155
return undefined
154156
}
155-
}
157+
})
156158

157159
const ChainNameMap: Record<NetworkPluginID, Record<number, string>> = {
158160
[NetworkPluginID.PLUGIN_EVM]: {
@@ -184,7 +186,8 @@ export function checkBlurToken(pluginId: NetworkPluginID, chainId: Web3Helper.Ch
184186
return `${resolveChain(pluginId, chainId)}.${address.toLowerCase()}` === `ethereum.${ETH_BLUR_TOKEN_ADDRESS}`
185187
}
186188

187-
export function checkLensFollower(name: string) {
189+
export function isLensFollower(name: string) {
190+
if (!name) return false
188191
return name.endsWith('.lens-Follower')
189192
}
190193

0 commit comments

Comments
 (0)