-
Notifications
You must be signed in to change notification settings - Fork 5
fix: check ipni advertisement during upload #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: check ipni advertisement during upload #183
Conversation
0ba8701 to
7d4303d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
| const uploadResult = await executeUpload(synapseService, carData, rootCid, { | ||
| logger, | ||
| contextId: `${contextType}-${Date.now()}`, | ||
| ipniValidation: { enabled: false }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not displaying ipfs gateway urls in CLI currently, so we disable it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds IPNI (InterPlanetary Network Indexer) validation to the upload flow, ensuring that uploaded content is announced and discoverable on the IPFS network before displaying IPFS gateway URLs. The validation is enabled by default but can be disabled when needed.
- Introduces a new
validateIPNIAdvertisementutility that pollsfilecoinpin.contactto verify IPFS CID announcements - Integrates IPNI validation into the upload execution flow, with the validation starting after upload completion
- Updates output display logic to show "Waiting for IPNI announcement" instead of preview URLs when validation is pending
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/utils/validate-ipni-advertisement.ts |
New utility function that polls IPNI with retry logic and progress callbacks |
src/core/utils/types.ts |
New type definitions for progress events and handlers |
src/core/utils/index.ts |
Exports the new IPNI validation utility |
src/core/upload/index.ts |
Integrates IPNI validation into the upload flow with configurable options |
src/test/unit/validate-ipni-advertisement.test.ts |
Comprehensive test coverage for IPNI validation behavior |
upload-action/src/types.ts |
Adds ipniValidated boolean to the upload result interface |
upload-action/src/upload.js |
Threads ipniValidated field through the upload action flow |
upload-action/src/outputs.js |
Conditionally displays gateway URLs based on IPNI validation status |
upload-action/src/filecoin.js |
Configures IPNI validation with progress callbacks and removes fallback preview URL |
src/common/upload-flow.ts |
Explicitly disables IPNI validation for this flow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(ci): handle duplicate items in add-to-project workflow Add continue-on-error to prevent workflow failure when an issue/PR already exists in the project board. The actions/add-to-project action does not currently handle this case gracefully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(ci): only run workflow when team/fs-wg label is added Add conditional to prevent workflow from running on every labeled event. Now it only runs when the specific 'team/fs-wg' label is added, avoiding duplicate runs when multiple labels are added at once. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
* Explicitly declare direct dep rather than rely on synapse * cdn endEpoch removed from ds info * 10 day grace period => 30 day grace period * fix: plumb --warm-storage-address through `payments setup` * fix: check lockup period during allowance check * chore: update to synapse@next tag, fix test failures & update more lockup mismatches * post rebase wip * Update synapse to v0.35.0 * Make things compile with add piece and create all in one * chore: fix onPieceAdded txHash * fix test --------- Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com> Co-authored-by: Rod Vagg <rod@vagg.org> Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
…before-showing-ipfs-mainnet-retrieval-urls
This change adds first-class IPNI announcement validation to filecoin-pin core and wires it into the GitHub Action:
ipniValidatedis true.Follow-up: The CLI improvements in #169 will switch to consume this core method and its onProgress callback instead of rolling its own polling, and switch the CLI default of ipniValidation to
enabled: true.Fixes #137
References: