Skip to content

Conversation

@Dexterp37
Copy link
Contributor

@Dexterp37 Dexterp37 commented Apr 9, 2021

With this, we're down to 18 17! 🥳

I also fixed a bug in our linting configuration about semicolon!

@Dexterp37 Dexterp37 self-assigned this Apr 9, 2021
@Dexterp37 Dexterp37 changed the title Break the circular dependency between pings/index.ts and pings/maker.ts Bug 1701578 - Break the circular dependency between pings/index.ts and pings/maker.ts Apr 9, 2021
@Dexterp37 Dexterp37 requested a review from brizental April 9, 2021 11:25
@Dexterp37 Dexterp37 marked this pull request as ready for review April 9, 2021 11:31
Copy link
Contributor

@brizental brizental left a comment

Choose a reason for hiding this comment

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

Only nits. Today I am nitpicky.

Otherwise, LGTM.

// The value of the X-Source-Tags header to be included in every ping.
sourceTags?: string[],
}
import { DebugOptions } from "./debug_options.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was it necessary to move this into another file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because due to the other imports in the config.ts file, if we wanted to use DebugOptions in the pings module without splitting it, we'd create a new circular dependency :)

This change is why this PR allows us to drop 2 circular dependencies :)

*/
export async function collectAndStorePing(identifier: string, ping: PingType, reason?: string): Promise<void> {
const collectedPayload = await collectPing(ping, reason);
export async function collectAndStorePing(metricsDatabase: MetricsDatabase, eventsDatabase: EventsDatabase, pingsDatabase: PingsDatabase, applicationId: string, identifier: string, ping: CommonPingData, reason?: string, debugOptions?: DebugOptions): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Give a default value to the debug options and we don't need to put in the end of the arguments list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Dexterp37 Dexterp37 merged commit de3b091 into mozilla:main Apr 9, 2021
@Dexterp37 Dexterp37 deleted the ping_maker_dep branch April 9, 2021 14:30
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