Skip to content

Conversation

@georgepsarakis
Copy link
Contributor

@georgepsarakis georgepsarakis commented Dec 5, 2023

Description

  • [backend]: Adds the User.last_active_at timestamp field in the user model, see Backend API docs.
  • [backend]: Adds the last_active_at_since filtering parameter when requesting the list of users, see Backend API docs.
  • [backend]: Adds the last_active_at as a valid option for the orderBy parameter for the UserList request, see Backend API docs.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: 422e36c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@clerk/backend Minor
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@georgepsarakis georgepsarakis marked this pull request as ready for review December 5, 2023 09:06
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Please add a description to your PR explaining what it does. Thanks!

## How to use

Works on Node.js `>=18.18.0` (or later) or on any V8 Isolates runtimes (eg Cloudflare Workers).
Works on Node.js `>=18.17.0` (or later) or on any V8 Isolates runtimes (eg Cloudflare Workers).
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd drop this change from the PR (as it's unrelated) and put it into a separate one as this needs fixing in all READMEs

Copy link
Contributor

Choose a reason for hiding this comment

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

PR for this is up: #2264

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, thanks!

},
"engines": {
"node": ">=18.17.0"
"node": ">=18.18.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll want to drop that change as we need 18.17.0 for Vercel

@georgepsarakis georgepsarakis force-pushed the georgepsarakis-CORE-960-users-last-active-at branch 2 times, most recently from 9c0b2d2 to de0e430 Compare December 5, 2023 11:53
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Once the typo is fixed, LGTM


- Added the `User.last_active_at` timestamp field which stores the latest date of session activity, with day precision. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUser).
- Added the `last_active_at_since` filtering parameter for the Users listing request. The new parameter can be used to retrieve users that have displayed session activity since the given date. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList).
- Adde the `last_active_at` available options for the `orderBy` parameter of the Users listing request. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Adde the `last_active_at` available options for the `orderBy` parameter of the Users listing request. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList).
- Added the `last_active_at` available options for the `orderBy` parameter of the Users listing request. For further details, please consult the [Backend API documentation](https://clerk.com/docs/reference/backend-api/tag/Users#operation/GetUserList).

Small typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this!

- User.last_active_at stores the last date of session activity for the user,
  with day precision
- last_active_at can be used to order users when listing
- last_active_at_since can be used to filter users based on their latest
  activity date
@georgepsarakis georgepsarakis force-pushed the georgepsarakis-CORE-960-users-last-active-at branch from de0e430 to 422e36c Compare December 6, 2023 10:21
@georgepsarakis georgepsarakis added this pull request to the merge queue Dec 6, 2023
Merged via the queue into main with commit a6b893d Dec 6, 2023
@georgepsarakis georgepsarakis deleted the georgepsarakis-CORE-960-users-last-active-at branch December 6, 2023 10:32
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.

5 participants