Compare commits

...

2 Commits

Author SHA1 Message Date
bee-worker 9d2d271c20 chore(master): release 0.20.2 (#552) 2022-09-15 17:05:48 +02:00
Adam Uhlíř c0456a3bf6 fix: stamp purchasing (#551) 2022-09-15 17:02:11 +02:00
4 changed files with 22 additions and 7 deletions
+7
View File
@@ -1,5 +1,12 @@
# Changelog
## [0.20.2](https://github.com/ethersphere/bee-dashboard/compare/v0.20.1...v0.20.2) (2022-09-15)
### Bug Fixes
* stamp purchasing ([#551](https://github.com/ethersphere/bee-dashboard/issues/551)) ([c0456a3](https://github.com/ethersphere/bee-dashboard/commit/c0456a3bf6d541457b706670b1a757d2b1d70f10))
## [0.20.1](https://github.com/ethersphere/bee-dashboard/compare/v0.20.0...v0.20.1) (2022-09-15)
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@ethersphere/bee-dashboard",
"version": "0.20.1",
"version": "0.20.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ethersphere/bee-dashboard",
"version": "0.20.1",
"version": "0.20.2",
"license": "BSD-3-Clause",
"dependencies": {
"@ethersphere/bee-js": "^5.0.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@ethersphere/bee-dashboard",
"version": "0.20.1",
"version": "0.20.2",
"description": "An app which helps users to setup their Bee node and do actions like cash out cheques",
"keywords": [
"bee",
+12 -4
View File
@@ -1,4 +1,4 @@
import { BatchId, BeeDebug, PostageBatch } from '@ethersphere/bee-js'
import { BatchId, BeeDebug, BeeResponseError, PostageBatch } from '@ethersphere/bee-js'
import { decodeCid } from '@ethersphere/swarm-cid'
import { BigNumber } from 'bignumber.js'
import { BZZ_LINK_DOMAIN } from '../constants'
@@ -229,7 +229,7 @@ export function shortenText(text: string, length = 20, separator = '[…]'): str
}
const DEFAULT_POLLING_FREQUENCY = 1_000
const DEFAULT_STAMP_USABLE_TIMEOUT = 240_000
const DEFAULT_STAMP_USABLE_TIMEOUT = 5 * 60_000
interface Options {
pollingFrequency?: number
@@ -254,9 +254,17 @@ async function waitForStamp(
const pollingFrequency = options?.pollingFrequency || DEFAULT_POLLING_FREQUENCY
for (let i = 0; i < timeout; i += pollingFrequency) {
const stamp = await beeDebug.getPostageBatch(batchId)
try {
const stamp = await beeDebug.getPostageBatch(batchId)
if (stamp[field]) return stamp
} catch (e) {
// TODO: Workaround for https://github.com/ethersphere/bee/issues/3300
if ((e as BeeResponseError).message !== 'Bad Request: cannot get batch') {
throw e
}
}
if (stamp[field]) return stamp
await sleepMs(pollingFrequency)
}