Skip to content

fix: rename publilishEvent to publishEvent across codebase#6

Open
Erebuzzz wants to merge 3 commits intoatithi4dev:mainfrom
Erebuzzz:fix/typo-publishEvent
Open

fix: rename publilishEvent to publishEvent across codebase#6
Erebuzzz wants to merge 3 commits intoatithi4dev:mainfrom
Erebuzzz:fix/typo-publishEvent

Conversation

@Erebuzzz
Copy link

@Erebuzzz Erebuzzz commented Feb 6, 2026

Summary

Fixed typo in function name publilishEvent → publishEvent across the codebase.

Changes

  • Renamed function in 11 files (38+ usages)
  • Fixed docker-compose.dev.yml double slash path
  • Removed unused options variable in auth.controller.ts

Verification

  • Grep search confirms zero remaining typos

- Fixed typo in function name from publilishEvent to publishEvent

- Updated 11 files with 38+ usages

- Fixed docker-compose.dev.yml double slash path

- Removed unused options variable in auth.controller.ts
Copilot AI review requested due to automatic review settings February 6, 2026 20:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a misspelled event publishing function name (publilishEventpublishEvent) across the TypeScript services/workers and the builder image scripts, plus a small docker-compose path cleanup and minor auth controller cleanup.

Changes:

  • Renamed publilishEvent to publishEvent and updated imports/exports/usages across the repo.
  • Fixed an invalid double-slash env_file path in docker-compose.dev.yml.
  • Removed an unused variable and did formatting cleanup in auth.controller.ts.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/domain/src/publisher.ts Renames exported event publisher to publishEvent.
packages/domain/src/index.ts Re-exports publishEvent from the domain package entrypoint.
docker-compose.dev.yml Fixes double-slash path in env_file.
api-gateway/src/controllers/deployment.controller.ts Updates import and call site to publishEvent.
api-gateway/src/controllers/auth.controller.ts Removes unused variable and reformats refresh token handler.
WORKERS/clone-worker/src/workers/clone.ts Updates domain import and calls to publishEvent.
WORKERS/build-worker/src/workers/build.ts Updates domain import and calls to publishEvent.
WORKERS/build-worker/src/services/distributionHandler/buildFrontend.ts Updates domain import and calls to publishEvent.
WORKERS/build-worker/src/services/distributionHandler/buildBackend.ts Updates domain import and calls to publishEvent.
BUILDER_IMAGES/builder-image-frontend/script.js Updates require and calls to publishEvent.
BUILDER_IMAGES/builder-image-frontend/publisher.js Renames function/export to publishEvent.
BUILDER_IMAGES/build-image-backend/script.js Updates require/calls to publishEvent.
BUILDER_IMAGES/build-image-backend/publisher.js Renames function/export to publishEvent (but retains some problematic debug/export code).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +146 to 154
) as { tokenVersion: number, sub: string };

const user = await User.findById(decodedToken?.sub);
if(!user){
if (!user) {
throw new ApiError(404, "Invalid refresh Token");
}

if(decodedToken?.tokenVersion! != user?.tokenVersion){
if (decodedToken?.tokenVersion! != user?.tokenVersion) {
throw new ApiError(404, "Invalid Refresh Token");
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

decodedToken.tokenVersion and user.tokenVersion are numbers; using != introduces type coercion and can mask unexpected types. Prefer a strict comparison (!==) (and you likely don’t need the optional chaining / non-null assertion here since jwt.verify is typed to return the required fields).

Copilot uses AI. Check for mistakes.
Comment on lines 163 to 165
} catch (error) {
throw new ApiError(404, "Failed to refresh refresh-token");
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

The catch-all error path throws a 404 (Not Found) for any refresh failure, including JWT verification errors and server issues. Consider returning a 401/403 for invalid/expired refresh tokens and a 500 for unexpected failures, and avoid the duplicated wording in the message ("refresh refresh-token").

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +35
module.exports = { publishEvent };


console.log("publilishEvent type:", typeof publilishEvent);
console.log("publishEvent type:", typeof publishEvent);

module.exports = { publilishEvent }; No newline at end of file
module.exports = { publishEvent }; No newline at end of file
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

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

module.exports is assigned twice and there's a top-level console.log that will run on every require/import. This creates noisy logs in production and makes the module harder to reason about; keep a single export assignment and remove the debug log (or gate it behind an explicit debug flag).

Copilot uses AI. Check for mistakes.
Erebuzzz and others added 2 commits February 7, 2026 02:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Feb 7, 2026
Merged
@github-actions
Copy link

PR Update Needed

This PR has been waiting for 14 days. Please:

  • Address review comments if any
  • Rebase on latest test branch
  • Resolve any conflicts
  • Push updates

If this PR is no longer needed, please close it. Thank you!

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