Skip to content

fix zero-length nanoids and update pgrx to 0.19.2 - #185

Merged
t3hmrman merged 1 commit into
VADOSWARE:mainfrom
pgsty:codex/fix-nanoid-pgrx-0.19.2-upstream
Sep 10, 2026
Merged

t3hmrman merged 1 commit into
VADOSWARE:mainfrom
pgsty:codex/fix-nanoid-pgrx-0.19.2-upstream

Conversation

@Vonng

@Vonng Vonng commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

idkit_nanoid_custom_generate_text(0, 'abc') enters a non-terminating loop in nanoid 0.4.0. Return an empty string when the normalized length is zero, preserving the existing negative-length clamp and positive-length generation. Add regression tests for zero, -1, and i64::MIN.

Fixes #184

This change is based on current upstream main (3183860) and preserves its dependency and CI action updates. The lockfile resolves uuid to 1.26.0 because pgrx 0.19.2 requires ^1.23.2; this remains within the project's existing ^1.20 requirement. The upstream getrandom 0.4.1 and recent anyhow, chrono, time, and keccak updates are retained.

The pgrx migration also:

  • Pins pgrx and the existing pgrx-tests dependency to =0.19.2, refreshing their runtime and test dependency graph without adding a direct runtime dependency.
  • Raises the declared MSRV to 1.96, pins Rust 1.98.0, and aligns current CI, Justfile, and Docker build defaults while retaining the existing OS base images.
  • Removes the PG13 feature and RPM variant, retaining PG14–18.
  • Removes the obsolete pgrx_embed binary declaration and source file, which use a macro removed from current pgrx.

Validation on Rocky Linux 9.8, aarch64, PostgreSQL 17.11, Rust 1.98.0, and cargo-pgrx 0.19.2:

  • Release RPM build passed; main, debuginfo, and debugsource payloads were checked, including DWARF and runtime dependencies.
  • Five targeted NanoID native tests passed; 39 other tests were filtered out.
  • After reinstalling the produced RPM, SQL checks passed for NanoID boundaries, valid lengths, alphabets, strict NULLs, and table defaults; UUIDv6/v7 text and UUID APIs plus timestamp extraction; and ULID/CUID2 smoke tests. The installed library matched the RPM payload by SHA-256.

The MSRV toolchain, other PG/OS combinations, and upstream CI were not run in this validation.

@Vonng
Vonng requested a review from t3hmrman as a code owner September 6, 2026 12:35

@t3hmrman t3hmrman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🚀

Sorry I'm a bit late here but thanks for the contribution @Vonng !

@t3hmrman
t3hmrman added this pull request to the merge queue Sep 10, 2026
Merged via the queue into VADOSWARE:main with commit 8857aa8 Sep 10, 2026
8 checks passed
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.

Zero-length custom NanoID generation hangs

2 participants