Skip to content

test(gotrue): give the list-users fixture a created_at - #1686

Merged
spydon merged 1 commit into
mainfrom
fix/gotrue-list-users-created-at
Aug 12, 2026
Merged

test(gotrue): give the list-users fixture a created_at#1686
spydon merged 1 commit into
mainfrom
fix/gotrue-list-users-created-at

Conversation

@spydon

@spydon spydon commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Test fix.

What is the current behavior?

main is red. Every test in packages/gotrue/test/admin_list_users_test.dart throws:

FormatException: Expected created_at to be a string, got Null
  package:supabase_common/src/timestamp.dart 16:5  parseIso8601
  package:gotrue/src/types/user.dart 72:18         User.fromJson
  package:gotrue/src/gotrue_admin_api.dart 179:54  GoTrueAdminApi.listUsers.<fn>

#1663 made User.createdAt a non-nullable DateTime parsed with parseIso8601, which throws when the field is absent. The mock list-users response in that file only carries an id, so listUsers() fails to parse the page before any of the pagination assertions run. It fails on all three Dart channels, see run 31509351637.

What is the new behavior?

The fixture user has a created_at, which is what the GoTrue server always sends for a user. The five tests in the file pass again, and the rest of the gotrue suite is unaffected.

Summary by CodeRabbit

  • Tests
    • Updated the user listing test data to include account creation timestamps, improving coverage of returned user information.

User.fromJson requires created_at since timestamps became DateTime, and the
mock response only carried an id, so every test in the file threw.
@spydon
spydon requested a review from a team as a code owner August 11, 2026 16:14
@github-actions github-actions Bot added the auth This issue or pull request is related to authentication label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cfe1fa62-50d4-454d-ac8e-b054a0bcab12

📥 Commits

Reviewing files that changed from the base of the PR and between bad3af8 and bc20164.

📒 Files selected for processing (1)
  • packages/gotrue/test/admin_list_users_test.dart

📝 Walkthrough

Walkthrough

The admin list-users test mock now includes a fixed created_at timestamp for the returned user.

Changes

Admin list-users test

Layer / File(s) Summary
Update mocked user response
packages/gotrue/test/admin_list_users_test.dart
The mocked user object now includes a fixed created_at timestamp.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: dshukertjr

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the test fixture change by identifying the GoTrue list-users fixture and its added created_at field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/gotrue-list-users-created-at

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@spydon
spydon merged commit 85ec6dc into main Aug 12, 2026
39 checks passed
@spydon
spydon deleted the fix/gotrue-list-users-created-at branch August 12, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth This issue or pull request is related to authentication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants