-
Notifications
You must be signed in to change notification settings - Fork 11.7k
fix: break circular dependency by passing creditCheckFn in messageDispatcher #25343
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
91f2c7e
fix: break circular dependency in messageDispatcher via dependency in…
devin-ai-integration[bot] f120f70
feat: wire creditCheckFn from all callers to complete circular depend…
devin-ai-integration[bot] ec34c0a
fix: use generic type with type guard in logFailedResults to fix type…
devin-ai-integration[bot] ba7ae4c
wip
hbjORbj 3db6d92
wip
hbjORbj 7c96fb8
wip
hbjORbj 4f4cf37
revert
hbjORbj 2821381
revert
hbjORbj c1defd0
feat: wire creditCheckFn from all remaining callers to eliminate fall…
devin-ai-integration[bot] 05eecdd
test: update formSubmissionUtils tests to expect creditCheckFn parameter
devin-ai-integration[bot] cbe82b4
test: update sms-manager test to expect creditCheckFn parameter
devin-ai-integration[bot] 0c693ee
feat: make creditCheckFn required to fully break circular dependency
devin-ai-integration[bot] a17ef40
fix: make creditCheckFn required in WorkflowService.scheduleFormWorkf…
devin-ai-integration[bot] ff1c748
remove
hbjORbj f550ec5
fix
hbjORbj a4b4255
Merge remote-tracking branch 'origin/main' into devin/messagedispatch…
hbjORbj d72f730
refactor
hbjORbj dfc0b7a
refactor
hbjORbj ef5ee6b
refactor
hbjORbj 6c0fc96
wip
hbjORbj d1e45cb
fix
hbjORbj e9227a5
fix
hbjORbj e45282c
Merge branch 'main' into devin/messagedispatcher-circular-1763790475
hbjORbj e379c69
rm
hbjORbj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,25 +158,28 @@ describe("_onFormSubmission", () => { | |
| await _onFormSubmission(mockForm, mockResponse, responseId); | ||
|
|
||
| expect(WorkflowService.getAllWorkflowsFromRoutingForm).toHaveBeenCalledWith(mockForm); | ||
| expect(WorkflowService.scheduleFormWorkflows).toHaveBeenCalledWith({ | ||
| workflows: mockWorkflows, | ||
| responses: { | ||
| email: { | ||
| value: "[email protected]", | ||
| response: "[email protected]", | ||
| expect(WorkflowService.scheduleFormWorkflows).toHaveBeenCalledWith( | ||
| expect.objectContaining({ | ||
| workflows: mockWorkflows, | ||
| responses: { | ||
| email: { | ||
| value: "[email protected]", | ||
| response: "[email protected]", | ||
| }, | ||
| name: { value: "Test Name", response: "Test Name" }, | ||
| }, | ||
| name: { value: "Test Name", response: "Test Name" }, | ||
| }, | ||
| responseId, | ||
| routedEventTypeId: null, | ||
| form: { | ||
| ...mockForm, | ||
| fields: mockForm.fields.map((field) => ({ | ||
| type: field.type, | ||
| identifier: field.identifier, | ||
| })), | ||
| }, | ||
| }); | ||
| responseId, | ||
| routedEventTypeId: null, | ||
| form: { | ||
| ...mockForm, | ||
| fields: mockForm.fields.map((field) => ({ | ||
| type: field.type, | ||
| identifier: field.identifier, | ||
| })), | ||
| }, | ||
| creditCheckFn: expect.any(Function), | ||
| }) | ||
| ); | ||
| }); | ||
|
|
||
| it("should call WorkflowService.scheduleFormWorkflows for FORM_SUBMITTED_NO_EVENT workflows", async () => { | ||
|
|
@@ -212,25 +215,28 @@ describe("_onFormSubmission", () => { | |
| await _onFormSubmission(mockForm, mockResponse, responseId); | ||
|
|
||
| expect(WorkflowService.getAllWorkflowsFromRoutingForm).toHaveBeenCalledWith(mockForm); | ||
| expect(WorkflowService.scheduleFormWorkflows).toHaveBeenCalledWith({ | ||
| workflows: mockWorkflows, | ||
| responses: { | ||
| email: { | ||
| value: "[email protected]", | ||
| response: "[email protected]", | ||
| expect(WorkflowService.scheduleFormWorkflows).toHaveBeenCalledWith( | ||
| expect.objectContaining({ | ||
| workflows: mockWorkflows, | ||
| responses: { | ||
| email: { | ||
| value: "[email protected]", | ||
| response: "[email protected]", | ||
| }, | ||
| name: { value: "Test Name", response: "Test Name" }, | ||
| }, | ||
| name: { value: "Test Name", response: "Test Name" }, | ||
| }, | ||
| routedEventTypeId: null, | ||
| responseId, | ||
| form: { | ||
| ...mockForm, | ||
| fields: mockForm.fields.map((field) => ({ | ||
| type: field.type, | ||
| identifier: field.identifier, | ||
| })), | ||
| }, | ||
| }); | ||
| routedEventTypeId: null, | ||
| responseId, | ||
| form: { | ||
| ...mockForm, | ||
| fields: mockForm.fields.map((field) => ({ | ||
| type: field.type, | ||
| identifier: field.identifier, | ||
| })), | ||
| }, | ||
| creditCheckFn: expect.any(Function), | ||
| }) | ||
| ); | ||
| }); | ||
|
|
||
| it("should pass routedEventTypeId when chosenAction is eventTypeRedirectUrl", async () => { | ||
|
|
@@ -271,25 +277,28 @@ describe("_onFormSubmission", () => { | |
|
|
||
| await _onFormSubmission(mockForm, mockResponse, responseId, chosenAction); | ||
|
|
||
| expect(WorkflowService.scheduleFormWorkflows).toHaveBeenCalledWith({ | ||
| workflows: mockWorkflows, | ||
| responses: { | ||
| email: { | ||
| value: "[email protected]", | ||
| response: "[email protected]", | ||
| expect(WorkflowService.scheduleFormWorkflows).toHaveBeenCalledWith( | ||
| expect.objectContaining({ | ||
| workflows: mockWorkflows, | ||
| responses: { | ||
| email: { | ||
| value: "[email protected]", | ||
| response: "[email protected]", | ||
| }, | ||
| name: { value: "Test Name", response: "Test Name" }, | ||
| }, | ||
| name: { value: "Test Name", response: "Test Name" }, | ||
| }, | ||
| routedEventTypeId: 42, | ||
| responseId, | ||
| form: { | ||
| ...mockForm, | ||
| fields: mockForm.fields.map((field) => ({ | ||
| type: field.type, | ||
| identifier: field.identifier, | ||
| })), | ||
| }, | ||
| }); | ||
| routedEventTypeId: 42, | ||
| responseId, | ||
| form: { | ||
| ...mockForm, | ||
| fields: mockForm.fields.map((field) => ({ | ||
| type: field.type, | ||
| identifier: field.identifier, | ||
| })), | ||
| }, | ||
| creditCheckFn: expect.any(Function), | ||
| }) | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.