Skip to content

fix: ability to upload the same file after deleting#197

Open
IgorShadurin wants to merge 2 commits into
masterfrom
fix/192-upload-deleted-file-again
Open

fix: ability to upload the same file after deleting#197
IgorShadurin wants to merge 2 commits into
masterfrom
fix/192-upload-deleted-file-again

Conversation

@IgorShadurin
Copy link
Copy Markdown
Contributor

@IgorShadurin IgorShadurin commented Dec 15, 2022

Close #192

@IgorShadurin IgorShadurin marked this pull request as ready for review December 15, 2022 12:19
@IgorShadurin IgorShadurin requested a review from nugaon as a code owner December 15, 2022 12:19
Copy link
Copy Markdown
Collaborator

@nugaon nugaon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/account/account.ts Outdated
Comment thread src/feed/api.ts Outdated
@IgorShadurin IgorShadurin requested a review from nugaon January 17, 2023 14:50
@IgorShadurin IgorShadurin force-pushed the fix/192-upload-deleted-file-again branch from f73bc81 to fd584fa Compare January 19, 2023 12:23
Copy link
Copy Markdown
Collaborator

@nugaon nugaon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread package.json
Comment thread src/file/file.ts Outdated
Comment on lines +112 to +118
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) {}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this snippet could be moved to writeFeedData to ensure the feed write will happen on the next free index, wdyt?

Comment thread src/feed/api.ts

return socWriter.upload(connection.postageBatchId, id, data)
return await socWriter.upload(connection.postageBatchId, id, data, {
pin: true,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need pinning? we do not require this

@IgorShadurin IgorShadurin force-pushed the fix/192-upload-deleted-file-again branch from fd584fa to ad5d959 Compare February 13, 2023 11:04
@plur9
Copy link
Copy Markdown
Member

plur9 commented Apr 18, 2026

This PR has been open for over 3 years (since December 2022) and has CHANGES_REQUESTED status. Is this still active? Please update with requested changes or close if abandoned.

@plur9
Copy link
Copy Markdown
Member

plur9 commented Apr 18, 2026

This PR has been open for over 3 years (since December 2022) with CHANGES_REQUESTED status. The fix for file upload after deletion may now be outdated or already addressed elsewhere.

Action required:

  • If this is still relevant, please address the requested changes, rebase against current main, and re-request review
  • If superseded by other work or no longer needed, please close this PR
  • If no response within 14 days, this PR will be closed as stale

cc @IgorShadurin

@plur9
Copy link
Copy Markdown
Member

plur9 commented Apr 27, 2026

Stale PR check — 2026-04-27 (CTO daily cadence)

This PR has been open since 2022-12-15 (over 3 years) with CHANGES_REQUESTED status. Is this still active? Please update or close if abandoned.

— CTO review cadence, automated check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fdp.file.uploadData does not allow overwrites

3 participants