-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: implement EboActor.onDisputeStatusChanged handler #24
Conversation
GRT-85 Implement onDisputeStatusUpdated
Actors should handle the event Given that there are multiple values for the dispute status:
There will a sub-issue per each status. GRT-101 Handle dispute status change to `None` GRT-102 Handle dispute status change to `Active` GRT-103 Handle dispute status change to `Escalated` GRT-104 Handle dispute status change to `Won` |
c36038b
to
7c7a185
Compare
case "Active": // Case handled by ResponseDisputed | ||
case "Lost": // Relevant during periodic request state checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add break here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to silently handle those three cases absorbing them and doing nothing; basically we don't need to react immediately to the status being changed; figured that a case
fallthrough was pretty simplistic here.
const dispute = this.getDispute(disputeId); | ||
|
||
// TODO: define a more verbose error for this | ||
if (dispute === undefined) throw new Error(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define it then 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaah damn, sorry, forgot to push the latest commit which has these changes prior opening the PR. Will have to force push 😢
expect(onTerminate).toHaveBeenCalledWith(actorRequest); | ||
}); | ||
|
||
it.skip("notifies when dispute has been escalated"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niceeeeeee
|
||
import { InvalidActorState } from "./exceptions/invalidActorState.exception.js"; | ||
import { InvalidDisputeStatus } from "./exceptions/invalidDisputeStatus.exception.js"; | ||
import { RequestMismatch } from "./exceptions/requestMismatch.js"; | ||
import { ResponseAlreadyProposed } from "./exceptions/responseAlreadyProposed.js"; | ||
import { EboRegistry } from "./interfaces/eboRegistry.js"; | ||
import { ProtocolProvider } from "./protocolProvider.js"; | ||
import { EboEvent } from "./types/events.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { InvalidActorState } from "./exceptions/invalidActorState.exception.js"; | |
import { InvalidDisputeStatus } from "./exceptions/invalidDisputeStatus.exception.js"; | |
import { RequestMismatch } from "./exceptions/requestMismatch.js"; | |
import { ResponseAlreadyProposed } from "./exceptions/responseAlreadyProposed.js"; | |
import { EboRegistry } from "./interfaces/eboRegistry.js"; | |
import { ProtocolProvider } from "./protocolProvider.js"; | |
import { EboEvent } from "./types/events.js"; | |
import { InvalidActorState } from "./exceptions"; | |
import { InvalidDisputeStatus } from "./exceptions"; | |
import { RequestMismatch } from "./exceptions"; | |
import { ResponseAlreadyProposed } from "./exceptions"; | |
import { EboRegistry } from "./interfaces"; | |
import { ProtocolProvider } from "./protocolProvider.js"; | |
import { EboEvent } from "./types"; |
7c7a185
to
e5d52fc
Compare
🤖 Linear
Closes GRT-85, GRT-101, GRT-102, GRT-103, GRT-104, GRT-105, GRT-106
Description
Handle events notifying dispute status changes.