Repository navigation
Conversation
…ooks Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
🧪 Code Coverage (vs
|
| if not notification_config.id: | ||
| notification_config.id = task_id |
There was a problem hiding this comment.
this leads to spec violation for on_create_task_push_notification_config (3.1.7: "Outputs: - TaskPushNotificationConfig: Created configuration with assigned ID")
on_create_task_push_notification_config is expected to set id for TaskPushNotificationConfig response if not provided by caller.
| logger.debug( | ||
| 'Push notification config for task %s with config id %s for owner %s saved/updated.', | ||
| task_id, | ||
| notification_config.id, |
There was a problem hiding this comment.
stored.id? notification_config.id can now be empty
| stored = TaskPushNotificationConfig() | ||
| stored.CopyFrom(notification_config) |
There was a problem hiding this comment.
Consider using _copy_config for consistency
|
Simulated this locally against |
Description
Fixes #1215
Summary
InMemoryPushNotificationConfigStore.set_infoappended the caller proto.get_infoandget_info_for_dispatchreturned those same objects.After create or get, changing url, token, or id on the request or response proto silently changed the stored webhook. The next notification POST went to the mutated URL.
The SQL store already CopyFroms. InMemoryTaskStore wraps CopyingTaskStoreAdapter for the same reason. The JS SDK cloned on save for this class of bug.
set_info now CopyFroms into a new proto before assign-id and append. get_info and get_info_for_dispatch return copies. Default id assignment stays on the stored copy, not the caller.
Testing
Added
test_set_info_copies_caller_and_returned_config.21 passed.