Skip to content

Commit 418216d

Browse files
authored
fix: upgrade subscriber-ts to include a few fixes (#82)
* fix: upgrade subscriber-ts to include a few fixes
1 parent daaae85 commit 418216d

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"pre-commit": "run-s check-types lint:fix audit test"
2323
},
2424
"dependencies": {
25-
"@algorandfoundation/algokit-subscriber": "^1.3.0-beta.6",
25+
"@algorandfoundation/algokit-subscriber": "^1.3.0",
2626
"@algorandfoundation/algokit-utils": "^6.0.4",
2727
"@blockshake/defly-connect": "^1.1.6",
2828
"@daffiwallet/connect": "^1.0.3",
@@ -155,4 +155,4 @@
155155
"semantic-release-export-data"
156156
]
157157
}
158-
}
158+
}

src/features/blocks/data/latest-blocks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { applicationResultsAtom } from '@/features/applications/data'
2424
import { syncedRoundAtom } from './synced-round'
2525
import { algod } from '@/features/common/data/algo-client'
2626

27-
const maxBlocksToDisplay = 5
27+
const maxBlocksToDisplay = 10
2828

2929
export const latestBlockSummariesAtom = atom<BlockSummary[]>([])
3030
const refreshLatestBlockSummariesEffect = atomEffect((get, set) => {
@@ -76,9 +76,9 @@ const subscribeToBlocksEffect = atomEffect((get, set) => {
7676
},
7777
},
7878
],
79-
maxRoundsToSync: 1,
79+
maxRoundsToSync: maxBlocksToDisplay,
8080
waitForBlockWhenAtTip: true,
81-
syncBehaviour: 'skip-sync-newest',
81+
syncBehaviour: 'sync-oldest-start-now',
8282
watermarkPersistence: {
8383
get: async () => get(syncedRoundAtom) ?? 0,
8484
set: async (watermark) => {

src/features/explore/pages/explorer-page.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('explore-page', () => {
100100
})
101101

102102
describe('when a large number of blocks have been processed', () => {
103-
const data = Array.from({ length: randomNumberBetween(6, 100) }, () => {
103+
const data = Array.from({ length: randomNumberBetween(11, 100) }, () => {
104104
const transactions = Array.from({ length: randomNumberBetween(10, 100) }, () => {
105105
return transactionResultMother.payment().build()
106106
})
@@ -121,7 +121,7 @@ describe('explore-page', () => {
121121
}
122122
)
123123

124-
it('only the latest 5 blocks are displayed', () => {
124+
it('only the latest 10 blocks are displayed', () => {
125125
const myStore = createStore()
126126
myStore.set(transactionResultsAtom, data.transactions)
127127
myStore.set(blockResultsAtom, data.blocks)
@@ -136,13 +136,13 @@ describe('explore-page', () => {
136136
const container = latestBlocks.parentElement!
137137
expect(data.blocks.size).toBeGreaterThan(5)
138138
const blockCards = getAllByRole(container, 'link')
139-
expect(blockCards.length).toBe(5)
139+
expect(blockCards.length).toBe(10)
140140
})
141141
}
142142
)
143143
})
144144

145-
it('the latest 50 transactions are displayed', () => {
145+
it('the latest 10 transactions are displayed', () => {
146146
const myStore = createStore()
147147
myStore.set(transactionResultsAtom, data.transactions)
148148
myStore.set(blockResultsAtom, data.blocks)
@@ -157,7 +157,7 @@ describe('explore-page', () => {
157157
const container = latestTransactions.parentElement!
158158
expect(data.transactions.size).toBeGreaterThan(50)
159159
const transactionCards = getAllByRole(container, 'link')
160-
expect(transactionCards.length).toBe(50)
160+
expect(transactionCards.length).toBe(10)
161161
})
162162
}
163163
)

src/features/transactions/data/latest-transactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { latestBlockSummariesAtom } from '@/features/blocks/data'
22
import { atom, useAtomValue } from 'jotai'
33
import { TransactionSummary } from '../models'
44

5-
const maxTransactionsToDisplay = 50
5+
const maxTransactionsToDisplay = 10
66

77
const createLatestTransactionSummariesAtom = () => {
88
return atom((get) => {

0 commit comments

Comments
 (0)