Conversation
This adds the optional trackingToken field to the Device request object for explicit device linking via the Device Tracking Add-on. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @oschwald, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces an enhancement to the "Device" request object by incorporating an optional "trackingToken" field. This addition facilitates explicit device linking, improving the integration with the Device Tracking Add-on. The change is fully backward compatible and includes updated documentation and comprehensive unit tests. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds an optional trackingToken field to the Device request object. The changes are well-implemented across the interface, class, documentation, and example usage. I've provided one suggestion to improve test coverage by adding a test that verifies the serialization of the new field, as this is mentioned in the test plan but not currently covered by the automated tests.
| it('sets trackingToken correctly', () => { | ||
| const device = new Device({ | ||
| ipAddress: '1.1.1.1', | ||
| trackingToken: 'abc123', | ||
| }); | ||
| expect(device.trackingToken).toBe('abc123'); | ||
| }); |
There was a problem hiding this comment.
The test plan mentions that the new trackingToken field serializes to tracking_token, but this is not covered in the tests. To ensure the serialization works as expected and to prevent future regressions, it would be valuable to add a test case that verifies this behavior. This test would likely involve the Transaction class and could be placed in transaction.spec.ts if that's more appropriate.
Here's an example of what such a test could look like:
import Transaction from '../transaction';
it('serializes device with tracking_token', () => {
const transaction = new Transaction({
device: new Device({
ipAddress: '1.1.1.1',
trackingToken: 'abc123',
}),
});
const result = JSON.parse(transaction.toString());
expect(result.device.tracking_token).toBe('abc123');
});There was a problem hiding this comment.
AFAICT, this is a pre-existing issue for all the request tests in this library.
Summary
trackingTokenfield to Device request object for explicit device linking via the Device Tracking Add-onENG-4047
Test plan
tracking_tokenvia snakecaseKeys()🤖 Generated with Claude Code