Skip to content

[Fil 1087] reproduce phantom commit and fix it#133

Merged
JAG-UK merged 2 commits intofidlabs:masterfrom
RafalMagrys:FIL-1087-reproduce-phantom-commit-and-fix-it
Nov 30, 2025
Merged

[Fil 1087] reproduce phantom commit and fix it#133
JAG-UK merged 2 commits intofidlabs:masterfrom
RafalMagrys:FIL-1087-reproduce-phantom-commit-and-fix-it

Conversation

@RafalMagrys
Copy link
Copy Markdown
Collaborator

@RafalMagrys RafalMagrys commented Nov 27, 2025

  • added method to return check if there are publishable events, instead of returning all of them all the time
  • added some typings to multisig return
  • added optional field 'source' to indicate where the edit comes from, so that updating the PR can be omitted when the edit source is GitHub

@RafalMagrys RafalMagrys requested a review from JAG-UK November 27, 2025 11:20
@RafalMagrys RafalMagrys self-assigned this Nov 27, 2025

const mocks = vi.hoisted(() => ({
logger: {
info: vi.fn((...args) => console.log(...args)),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to see logs in tests and having them mocked at the same time

public source: EventSource;

constructor(aggregateId: string) {
constructor(aggregateId: string, source: EventSource = 'api') {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made every event source an API by default. Only some of the edits will have a GitHub source, so they won't be published back to GitHub

expect(mocks.airtableClient.getTableRecords).toHaveBeenCalledTimes(1);
expect(mocks.commandBus.send).toHaveBeenCalledTimes(1);
expect(mocks.commandBus.send).toHaveBeenCalledWith(expect.any(CreateApplicationCommand));
expect(mocks.logger.error).toHaveBeenCalledWith(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these aren't the best test checks, but without refactoring the subscribers, I can't rely on anything other than the logs

data: { guid: '123' },
});

vi.useFakeTimers();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's necessary to test the timers correctly so that I can manipulate the awaits from setInterval and prevent them from overlapping

@JAG-UK JAG-UK merged commit 359de18 into fidlabs:master Nov 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants