Skip to content
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

feat: change default TTL and add support for custom TTL (#1) #308

Merged
merged 10 commits into from
Apr 2, 2024

Conversation

jtsmedley
Copy link
Contributor

  • Changes the Default TTL to the suggested default of 1 hour per the ipns-record spec
  • Allows for a custom TTL to be passed

Copy link

welcome bot commented Jan 25, 2024

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

jtsmedley and others added 2 commits January 25, 2024 17:11
* deps: bump @libp2p/crypto from 3.0.4 to 4.0.0 (ipfs#304)

Bumps [@libp2p/crypto](https://github.com/libp2p/js-libp2p) from 3.0.4 to 4.0.0.
- [Release notes](https://github.com/libp2p/js-libp2p/releases)
- [Changelog](https://github.com/libp2p/js-libp2p/blob/main/.release-please.json)
- [Commits](libp2p/js-libp2p@perf-v3.0.4...utils-v4.0.0)

---
updated-dependencies:
- dependency-name: "@libp2p/crypto"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(release): 8.0.2 [skip ci]

## [8.0.2](ipfs/js-ipns@v8.0.1...v8.0.2) (2024-01-15)

### Dependencies

* bump @libp2p/crypto from 3.0.4 to 4.0.0 ([ipfs#304](ipfs#304)) ([ed83244](ipfs@ed83244))

* fix: mark package as side-effect free (ipfs#305)

[Tree shaking](https://webpack.js.org/guides/tree-shaking/) results in smaller web bundles by deleting unused code.

This module is side-effect free so mark it as such to signal to bundlers that unused exports can be excluded from bundles.

* chore(release): 8.0.3 [skip ci]

## [8.0.3](ipfs/js-ipns@v8.0.2...v8.0.3) (2024-01-16)

### Bug Fixes

* mark package as side-effect free ([ipfs#305](ipfs#305)) ([a389fe8](ipfs@a389fe8))

* fix: log type as string (ipfs#306)

The value field is a string so it needs to be logged as `%s` - logging as `%b` will throw.

* chore(release): 8.0.4 [skip ci]

## [8.0.4](ipfs/js-ipns@v8.0.3...v8.0.4) (2024-01-18)

### Bug Fixes

* log type as string ([ipfs#306](ipfs#306)) ([de68e4c](ipfs@de68e4c))

* fix!: treat validity as opaque (ipfs#307)

Instead of parsing the validity field of an IPNS record as a timestamp
during unmarshalling, treat it as an opaque string value.

This ensures we can round-trip records supplied by other systems which
may have a different interpretation of rfc3339 dates, for example.

It also means we can handle different types of validity types, not
just EOL.

BREAKING CHANGE: the validity field is now a string

* chore(release): 9.0.0 [skip ci]

## [9.0.0](ipfs/js-ipns@v8.0.4...v9.0.0) (2024-01-18)

### ⚠ BREAKING CHANGES

* the validity field is now a string

### Bug Fixes

* treat validity as opaque ([ipfs#307](ipfs#307)) ([461190e](ipfs@461190e))

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: semantic-release-bot <[email protected]>
Co-authored-by: Alex Potsides <[email protected]>
@lidel lidel requested a review from achingbrain March 11, 2024 20:53
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@jtsmedley
Copy link
Contributor Author

Ran linter, updated tests to support new TTL check and added 2 new tests for custom TTL.

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
test/index.spec.ts Outdated Show resolved Hide resolved
test/index.spec.ts Outdated Show resolved Hide resolved
test/index.spec.ts Outdated Show resolved Hide resolved
Copy link
Member

@2color 2color left a comment

Choose a reason for hiding this comment

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

Nice! This is a nice improvement that also fixes bug #310.

LGTM. Pinging @achingbrain for a final review as the lead maintainer of this repo.

@achingbrain achingbrain changed the title Change default TTL and add support for custom TTL (#1) feat: change default TTL and add support for custom TTL (#1) Apr 2, 2024
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@achingbrain
Copy link
Member

@jtsmedley the tests are failing - could you take a look please?

@achingbrain achingbrain merged commit d647529 into ipfs:main Apr 2, 2024
16 checks passed
@achingbrain
Copy link
Member

Thanks!

github-actions bot pushed a commit that referenced this pull request Apr 2, 2024
## [9.1.0](v9.0.0...v9.1.0) (2024-04-02)

### Features

* change default TTL and add support for custom TTL ([#1](#1)) ([#308](#308)) ([d647529](d647529)), closes [/specs.ipfs.tech/ipns/ipns-record/#ttl-uint64](https://github.com/ipfs//specs.ipfs.tech/ipns/ipns-record//issues/ttl-uint64) [#310](#310)

### Trivial Changes

* add or force update .github/workflows/js-test-and-release.yml ([#311](#311)) ([0c5f3e1](0c5f3e1))
* add or force update .github/workflows/js-test-and-release.yml ([#312](#312)) ([46a2b72](46a2b72))
* add or force update .github/workflows/js-test-and-release.yml ([#313](#313)) ([e933496](e933496))
* Update .github/workflows/stale.yml [skip ci] ([16e0e10](16e0e10))
Copy link

github-actions bot commented Apr 2, 2024

🎉 This PR is included in version 9.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants