fix: ability to upload the same file after deleting#197
fix: ability to upload the same file after deleting#197IgorShadurin wants to merge 2 commits intomasterfrom
Conversation
nugaon
left a comment
There was a problem hiding this comment.
This whole fix seems wrong for me.
If there is a chunk conflict on feed upload, check whether the identifiers of SOC match or not, if so, the problem is there -> you shouldn't write to the same index.
f73bc81 to
fd584fa
Compare
nugaon
left a comment
There was a problem hiding this comment.
so if I understand, the problem was the writeFeedDataRaw attempted to write on a reserved index since the next subsequent index was not calculated.
it is quite strange since it should have thrown an error because of writing on a reserved index.
maybe instead of
if (!epoch) {
epoch = new Epoch(HIGHEST_LEVEL, getUnixTimestamp())
}
this snippet should find for the latest free index instead if epoch is not defined
src/file/file.ts
Outdated
| let nextEpoch | ||
| try { | ||
| const feedData = await getFeedData(connection.bee, fullPath, prepareEthAddress(podWallet.address)) | ||
| feedData.epoch.level = feedData.epoch.getNextLevel(feedData.epoch.time) | ||
| nextEpoch = feedData.epoch | ||
| // eslint-disable-next-line no-empty | ||
| } catch (e) {} |
There was a problem hiding this comment.
maybe this snippet could be moved to writeFeedData to ensure the feed write will happen on the next free index, wdyt?
|
|
||
| return socWriter.upload(connection.postageBatchId, id, data) | ||
| return await socWriter.upload(connection.postageBatchId, id, data, { | ||
| pin: true, |
There was a problem hiding this comment.
why do you need pinning? we do not require this
fd584fa to
ad5d959
Compare
Close #192