Skip to content

feat: refresh ipns record#891

Open
tabcat wants to merge 77 commits into
ipfs:mainfrom
tabcat:feat/refresh-record
Open

feat: refresh ipns record#891
tabcat wants to merge 77 commits into
ipfs:mainfrom
tabcat:feat/refresh-record

Conversation

@tabcat
Copy link
Copy Markdown
Contributor

@tabcat tabcat commented Oct 30, 2025

Title

feat: refresh ipns record

Description

Adds republish to IPNS and unpublish accepts ipns keys.

Changes resolve to not read localStore if nocache option is true.

Changes metadata to include a refresh field that is false by default. The #republish method reads this field to know which keys are being refreshed.

Closes #877

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@tabcat tabcat marked this pull request as ready for review October 31, 2025 01:48
@tabcat tabcat requested a review from a team as a code owner October 31, 2025 01:48
Comment thread packages/ipns/src/index.ts Outdated
Comment thread packages/ipns/src/pb/metadata.proto Outdated
@tabcat
Copy link
Copy Markdown
Contributor Author

tabcat commented Apr 16, 2026

this still needs some work. ill convert to ready when its ready for review.

Comment on lines +168 to +176
// resolve the latest record
let latestRecord: IPNSRecord
try {
const { record } = await this.resolver.resolve(multihashFromIPNSRoutingKey(routingKey))
latestRecord = record
} catch (err: any) {
this.log.error('unable to find existing record to republish - %e', err)
continue
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wondering if we should be resolving the latest record for refreshing. this server is set as the republisher for this routingKey. it should be the only one publishing to this key on the network. this could just be an offline resolution.

@tabcat tabcat marked this pull request as ready for review April 19, 2026 14:44
@tabcat tabcat requested a review from achingbrain April 19, 2026 14:44
Resolves conflicts from the multiformats@14 update (ipfs#1039):

- publisher.ts unpublish(): keep the branch's wider key parameter
  type; assign the resolved PublicKey directly rather than its
  multihash, so type narrowing survives and keyToMultihash() still
  accepts it without a @ts-expect-error
- pb/metadata.ts: keep the IPNSPublishMetadataUpkeepFieldEvent
  interface alongside main's regenerated Uint8Array<ArrayBuffer>
  encode() signature

Also extends the @ts-expect-error @libp2p/* multiformats shims main
added to branch code its sweep predated (utils.ts keyToMultihash,
publish/republish specs).
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.

feature request: @helia/ipns republish specific existing records

5 participants