Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send resource diff in the BotEvent #1242

Open
reshmakh opened this issue Dec 9, 2022 · 0 comments
Open

Send resource diff in the BotEvent #1242

reshmakh opened this issue Dec 9, 2022 · 0 comments
Labels
bots Features and fixes related to bots and automation enhancement New feature or request

Comments

@reshmakh
Copy link
Member

reshmakh commented Dec 9, 2022

We're starting to see more use cases for Bots where the author wants to do something when a specific change happens.

The primary example is a customer, where they want to perform some action when a ServiceRequests's status is changed from one value to another. Example

There is a workaround right now to call readHistory , but this is wasteful because you often only need the immediately preceding entry. There's also a potential race condition if the resource is frequently updated.

There are couple different ways we could represent the "diff":

Just add another property called BotEvent.previousInput that contains the entire object before the subscription was fired (i.e. calls readHistory on the user's behalf)

Add a BotEvent.diffs property that has a list of JSON patches containing all the changes made (seems complicated, but potentially less data?)

Add a BotEvent.diff property which is a JS object that contains only the fields that changed (weird?)

@reshmakh reshmakh added enhancement New feature or request bots Features and fixes related to bots and automation labels Dec 9, 2022
@rahul1 rahul1 added this to the Milestone Quality milestone Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bots Features and fixes related to bots and automation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants