Skip to content

Conversation

@gabeabrams
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the ability to override or supplement user information when logging client events. It allows callers to specify custom user ID, first name, and last name that will take precedence over session-based user information.

  • Added optional user override parameters to the LogFunction type definition
  • Modified logClientEvent to include overridden user info in the log payload
  • Bumped package version from 4.1.7 to 4.1.8

Reviewed Changes

Copilot reviewed 3 out of 11 changed files in this pull request and generated 2 comments.

File Description
src/types/LogFunction.ts Added optional userId, userFirstName, and userLastName parameters to LogFunction type
src/helpers/logClientEvent.tsx Added overriddenUserInfo object to log payload containing the override parameters
package.json Version bump to reflect the new feature

? (opts as any).action
: undefined
),
overriddenUserInfo: {
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The overriddenUserInfo object is always created even when all override values are undefined. Consider only including this object when at least one override value is provided to avoid unnecessary data in logs.

Copilot uses AI. Check for mistakes.
},
// Log level (default is info)
level?: LogLevel,
// Optional Canvas userId that overrides the current userId from the session (if there is one)
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment mentions 'Canvas userId' which appears to be domain-specific. Consider using more generic terminology like 'user ID' to make the API more reusable across different contexts.

Suggested change
// Optional Canvas userId that overrides the current userId from the session (if there is one)
// Optional user ID that overrides the current user ID from the session (if there is one)

Copilot uses AI. Check for mistakes.
Copy link
Member

@karendolan karendolan left a comment

Choose a reason for hiding this comment

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

Looks good

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.

3 participants