Skip to content

Comments

Apps#9434

Merged
evereq merged 17 commits intostage-appsfrom
stage
Feb 7, 2026
Merged

Apps#9434
evereq merged 17 commits intostage-appsfrom
stage

Conversation

@evereq
Copy link
Member

@evereq evereq commented Feb 7, 2026

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.



Summary by cubic

Migrated desktop apps to Angular standalone with lazy-loaded routes for faster startup and simpler bootstrapping. Added reliable offline timer sync tracking (start/stop states, IPC, DB migration) to prevent stuck timers and recover on restart.

  • Refactors

    • Replaced AppModule with bootstrapApplication across agent, desktop, desktop-timer, server, and server-api; AppComponent now standalone.
    • Switched routes to loadComponent and updated templates to Angular control flow; converted many desktop-ui-lib components/directives to standalone and removed redundant modules.
    • Initialized TranslateModule during bootstrap and added Nebular default theme CSS.
    • Simplified CI workflows and .gitignore; added a quick Mac agent build script.
    • Upgraded dependencies: webpack 5.104.1, @apollo/server 5.4.0, better-sqlite3 12.6.2.
  • New Features

    • Introduced timer sync state tracking (start/stop) with new enums and a local DB migration (startSyncState, stopSyncState, syncDuration).
    • Added IPC APIs (UPDATE_SYNC_STATE, check-unfinished-sync, set-to-offline) and a CleanTimer recovery to resolve unfinished syncs on restart.
    • Timer stop now records a pending stopSyncState; DAO/service can find and repair syncing timers.
    • Note: Launching the desktop app runs the local DB migration automatically.

Written for commit a64f7ed. Summary will update on new commits.

dependabot bot and others added 17 commits February 4, 2026 18:12
Bumps [@apollo/server](https://github.com/apollographql/apollo-server/tree/HEAD/packages/server) from 4.12.2 to 5.4.0.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/packages/server/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/@apollo/server@5.4.0/packages/server)

---
updated-dependencies:
- dependency-name: "@apollo/server"
  dependency-version: 5.4.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) from 1.25.3 to 1.26.0.
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](modelcontextprotocol/typescript-sdk@v1.25.3...v1.26.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.26.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
* refactor(desktop-ui): convert components and directives to standalone

Migrate numerous components, directives, and pipes within the desktop
UI library to Angular's standalone architecture. This update involves:
- Removing 'standalone: false' from component and directive decorators.
- Adding necessary dependencies to the 'imports' array of individual
standalone components.
- Moving declarations from NgModule metadata to the 'imports' array.
- Updating test suites to use 'imports' instead of 'declarations' for
standalone components.

* refactor: remove redundant modules in favor of standalone components

Clean up the codebase by removing several intermediate Angular modules,
including DesktopDirectiveModule, NoDataMessageModule, and
PaginationModule. Components and directives are now imported directly
into consuming modules, streamlining the dependency structure and
supporting the transition to standalone components.

* refactor(ui): migrate templates to angular control flow syntax

Update various components to use the new @if and @for control flow
syntax instead of *ngIf and *ngFor structural directives. This change
also removes unnecessary NgIf and NgFor imports from the component
metadata.

* perf(desktop-ui): use loadComponent for lazy loading routes

Replace static component imports with dynamic imports using the
loadComponent property in routing configurations. This optimization
enables lazy loading for these components, which helps reduce the
initial bundle size and improves the application's startup time.

* refactor: streamline component imports and remove unused modules

* refactor(desktop-ui-lib): update component imports and clean up modules

Add PipeModule to various recap components to provide necessary pipes.
Remove several standalone components from NgModule declarations and
exports as they are now managed via lazy loading or direct component
imports. Clean up and reorder imports across affected files for
consistency.

* refactor(time-tracker): remove form value accessor and clean up imports

Remove the NG_VALUE_ACCESSOR implementation and provider from the
TimeTrackerComponent. Clean up redundant component references in
TimeTrackerModule and reorganize imports for better maintainability.

* refactor(desktop-timer): migrate to standalone application architecture

Migrate the desktop-timer application from a module-based architecture
to a standalone application architecture using Angular's
bootstrapApplication API.
- Delete AppModule and move its logic to main.ts.
- Update AppRoutingModule to use loadComponent for route-level lazy
loading of components from @gauzy/desktop-ui-lib.
- Refactor RecapModule and SettingsModule to remove unnecessary
component declarations and exports.
- Consolidate application providers and third-party module
initializations in the bootstrap process.

* refactor(desktop-timer): convert AppComponent to standalone and simplify refresh

Convert the root AppComponent to a standalone component and add the
RouterOutlet to its imports. Simplify the initialization logic by
removing manual token checks before starting the token refresh service.

* refactor(desktop-ui-lib): replace LanguageModule with TranslateModule

Replace the internal LanguageModule with TranslateModule from
@ngx-translate/core in the recap and task-table modules. Additionally,
import PipeModule in GauzyFiltersComponent to ensure required pipes are
available.

* refactor(desktop): migrate to standalone bootstrapping

Remove AppModule and transition to the bootstrapApplication API in
main.ts. This includes moving all providers and imported modules from
the deleted app.module.ts into the bootstrap configuration, and
replacing BrowserAnimationsModule with provideAnimations.

* refactor(desktop): implement lazy loading and standalone component

Update the routing configuration to use lazy loading for all component
routes in app-routing.module.ts. Refactor AppComponent to support
standalone imports and simplify the token refresh service
initialization logic.

* refactor(agent): migrate to standalone bootstrap api

Remove the AppModule and use the bootstrapApplication function to
initialize the app. Convert AppComponent to a standalone component and
consolidate providers and module configurations in main.ts.

* perf(agent): use lazy loading for routes and simplify token refresh

Implement lazy loading for all routes in the agent application using the
`loadComponent` syntax. This improves the initial bundle size and
startup performance by loading component code only when needed.
Additionally, simplify the initialization of the token refresh service
in `AppComponent` by removing the manual check for existing tokens,
allowing the service to handle its own internal state logic.

* style(server): fix indentation in app component spec

Correct the whitespace and indentation in the app component specification
file to align with the project's formatting standards.

* refactor: migrate server applications to standalone bootstrapping

Remove AppModule from both server and server-api applications and
transition to the Angular standalone bootstrap API. Provider
configurations are moved to main.ts using bootstrapApplication and
importProvidersFrom.

* perf(routing): use lazy loading for desktop ui components

Replace static component imports with dynamic imports using the
loadComponent property in both server and server-api routing modules.
This optimization reduces the initial bundle size and improves
application startup performance by loading components from the
@gauzy/desktop-ui-lib only when needed.

* refactor(app): update component to use standalone imports for RouterOutlet

* refactor(routing): update auth routes to use consistent lazy loading and guards

* feat(build): add quick build script for mac agent

* refactor(routing): add AuthGuard to server-dashboard route for enhanced security

* feat(desktop): initialize TranslateModule in bootstrap process

Configure the ngx-translate TranslateModule within the application bootstrap logic. This setup includes the HttpLoaderFactory and HttpClient dependencies to enable internationalization support.

* build(gauzy): add nebular default theme styles

Include the @nebular/theme prebuilt default CSS file in the project
styles configuration to ensure UI components render correctly.

* refactor(apps): simplify bootstrap process and update providers

Streamline the bootstrap process for server and server-api applications
by removing unused Nebular and feature modules. Configure the
TranslateModule with HttpLoaderFactory and add Store to the application
providers. Additionally, remove the AuthConnectionGuard from routing
configurations and update global style paths in project.json.
Bumps [webpack](https://github.com/webpack/webpack) from 5.101.3 to 5.104.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](webpack/webpack@v5.101.3...v5.104.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.104.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
…ntextprotocol/sdk-1.26.0

chore(deps): bump @modelcontextprotocol/sdk from 1.25.3 to 1.26.0
…server-5.4.0

chore(deps): bump @apollo/server from 4.12.2 to 5.4.0
…-5.104.1

chore(deps-dev): bump webpack from 5.101.3 to 5.104.1
chore(deps): bump better-sqlite3 from 12.2.0 to 12.6.2
fix: update scripts and clear cached .gitignore files
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 7, 2026

Too many files changed for review. (246 files found, 100 file limit)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch stage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cla-assistant
Copy link

cla-assistant bot commented Feb 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 5 committers have signed the CLA.

✅ evereq
✅ rahul-rocket
✅ syns2191
✅ adkif
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@evereq evereq merged commit dbf123d into stage-apps Feb 7, 2026
17 of 21 checks passed
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
9.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

6 issues found across 246 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/server-api/src/app/app.component.ts">

<violation number="1" location="apps/server-api/src/app/app.component.ts:8">
P1: `imports` is only valid on standalone components; without `standalone: true` this will fail compilation. Mark the component as standalone or move RouterOutlet to the NgModule imports.</violation>
</file>

<file name="apps/desktop/src/main.ts">

<violation number="1" location="apps/desktop/src/main.ts:149">
P1: Duplicate `ErrorHandler` provider — the Sentry error handler (first registration) is completely overridden by the `ErrorHandlerService` (second registration). In Angular DI, only the last provider for a given token takes effect. Sentry error tracking will never receive errors.

Consider either:
1. Removing one of the two providers, or
2. Composing them — e.g., have `ErrorHandlerService` delegate to `Sentry.captureException()` internally.</violation>
</file>

<file name="apps/agent/src/main.ts">

<violation number="1" location="apps/agent/src/main.ts:189">
P2: Sentry providers (`Sentry.createErrorHandler`, `Sentry.TraceService`) are registered unconditionally, but `initializeSentry()` is only called when a valid `SENTRY_DSN` is present. When Sentry is not initialized, `createErrorHandler` becomes the active `ErrorHandler` (overriding `ErrorHandlerService`) but won't actually report errors to Sentry. Consider conditionally registering these providers, or at minimum ensure the error handler gracefully falls back when Sentry is not initialized.</violation>

<violation number="2" location="apps/agent/src/main.ts:189">
P1: Duplicate `ErrorHandler` provider — the first one (`ErrorHandlerService`) is silently overridden by the second one (`Sentry.createErrorHandler`). Angular DI uses the last-registered provider for a given token (when `multi` is not used), so `ErrorHandlerService` will never be instantiated.

If you intend to use both, create a composite error handler that delegates to both. If only Sentry's handler is desired, remove the `ErrorHandlerService` provider (and its import). If only `ErrorHandlerService` is desired, remove the Sentry provider.</violation>
</file>

<file name="apps/server/src/main.ts">

<violation number="1" location="apps/server/src/main.ts:69">
P1: The Sentry `ErrorHandler` and `TraceService` are registered unconditionally, but `initializeSentry()` is only called when `SENTRY_DSN` is present and valid. When Sentry is not initialized, `showDialog: true` will attempt to show a Sentry report dialog that cannot function without an active client, resulting in broken error handling.

Consider making the Sentry-related providers conditional, e.g., only include them when Sentry is actually initialized.</violation>
</file>

<file name="apps/server-api/src/main.ts">

<violation number="1" location="apps/server-api/src/main.ts:68">
P1: Sentry `ErrorHandler` and `TraceService` are unconditionally registered in the providers, but `Sentry.init()` is only called conditionally. When no `SENTRY_DSN` is set, the error handler with `showDialog: true` will still attempt to display a Sentry crash-report dialog on every error, which won't function correctly without an initialized client. These providers should be registered conditionally (matching the initialization guard), or use a fallback `ErrorHandler` when Sentry is not active.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

standalone: false
selector: 'gauzy-root',
template: '<router-outlet></router-outlet>',
imports: [RouterOutlet]
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 7, 2026

Choose a reason for hiding this comment

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

P1: imports is only valid on standalone components; without standalone: true this will fail compilation. Mark the component as standalone or move RouterOutlet to the NgModule imports.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/server-api/src/app/app.component.ts, line 8:

<comment>`imports` is only valid on standalone components; without `standalone: true` this will fail compilation. Mark the component as standalone or move RouterOutlet to the NgModule imports.</comment>

<file context>
@@ -1,10 +1,11 @@
-    standalone: false
+	selector: 'gauzy-root',
+	template: '<router-outlet></router-outlet>',
+	imports: [RouterOutlet]
 })
 export class AppComponent implements OnInit {
</file context>
Suggested change
imports: [RouterOutlet]
standalone: true,
imports: [RouterOutlet]
Fix with Cubic

multi: true
},
{
provide: ErrorHandler,
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 7, 2026

Choose a reason for hiding this comment

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

P1: Duplicate ErrorHandler provider — the Sentry error handler (first registration) is completely overridden by the ErrorHandlerService (second registration). In Angular DI, only the last provider for a given token takes effect. Sentry error tracking will never receive errors.

Consider either:

  1. Removing one of the two providers, or
  2. Composing them — e.g., have ErrorHandlerService delegate to Sentry.captureException() internally.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/main.ts, line 149:

<comment>Duplicate `ErrorHandler` provider — the Sentry error handler (first registration) is completely overridden by the `ErrorHandlerService` (second registration). In Angular DI, only the last provider for a given token takes effect. Sentry error tracking will never receive errors.

Consider either:
1. Removing one of the two providers, or
2. Composing them — e.g., have `ErrorHandlerService` delegate to `Sentry.captureException()` internally.</comment>

<file context>
@@ -17,6 +84,119 @@ akitaConfig({
+			multi: true
+		},
+		{
+			provide: ErrorHandler,
+			useValue: Sentry.createErrorHandler({
+				showDialog: true
</file context>
Fix with Cubic

multi: true
},
{
provide: ErrorHandler,
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 7, 2026

Choose a reason for hiding this comment

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

P1: Duplicate ErrorHandler provider — the first one (ErrorHandlerService) is silently overridden by the second one (Sentry.createErrorHandler). Angular DI uses the last-registered provider for a given token (when multi is not used), so ErrorHandlerService will never be instantiated.

If you intend to use both, create a composite error handler that delegates to both. If only Sentry's handler is desired, remove the ErrorHandlerService provider (and its import). If only ErrorHandlerService is desired, remove the Sentry provider.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/agent/src/main.ts, line 189:

<comment>Duplicate `ErrorHandler` provider — the first one (`ErrorHandlerService`) is silently overridden by the second one (`Sentry.createErrorHandler`). Angular DI uses the last-registered provider for a given token (when `multi` is not used), so `ErrorHandlerService` will never be instantiated.

If you intend to use both, create a composite error handler that delegates to both. If only Sentry's handler is desired, remove the `ErrorHandlerService` provider (and its import). If only `ErrorHandlerService` is desired, remove the Sentry provider.</comment>

<file context>
@@ -19,9 +92,136 @@ akitaConfig({
+			multi: true
+		},
+		{
+			provide: ErrorHandler,
+			useClass: ErrorHandlerService
+		},
</file context>
Fix with Cubic

Store,
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler({
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 7, 2026

Choose a reason for hiding this comment

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

P1: The Sentry ErrorHandler and TraceService are registered unconditionally, but initializeSentry() is only called when SENTRY_DSN is present and valid. When Sentry is not initialized, showDialog: true will attempt to show a Sentry report dialog that cannot function without an active client, resulting in broken error handling.

Consider making the Sentry-related providers conditional, e.g., only include them when Sentry is actually initialized.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/server/src/main.ts, line 69:

<comment>The Sentry `ErrorHandler` and `TraceService` are registered unconditionally, but `initializeSentry()` is only called when `SENTRY_DSN` is present and valid. When Sentry is not initialized, `showDialog: true` will attempt to show a Sentry report dialog that cannot function without an active client, resulting in broken error handling.

Consider making the Sentry-related providers conditional, e.g., only include them when Sentry is actually initialized.</comment>

<file context>
@@ -1,12 +1,91 @@
+		Store,
+		{
+			provide: ErrorHandler,
+			useValue: Sentry.createErrorHandler({
+				showDialog: true
+			})
</file context>
Fix with Cubic

LoggerService,
Store,
{
provide: ErrorHandler,
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 7, 2026

Choose a reason for hiding this comment

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

P1: Sentry ErrorHandler and TraceService are unconditionally registered in the providers, but Sentry.init() is only called conditionally. When no SENTRY_DSN is set, the error handler with showDialog: true will still attempt to display a Sentry crash-report dialog on every error, which won't function correctly without an initialized client. These providers should be registered conditionally (matching the initialization guard), or use a fallback ErrorHandler when Sentry is not active.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/server-api/src/main.ts, line 68:

<comment>Sentry `ErrorHandler` and `TraceService` are unconditionally registered in the providers, but `Sentry.init()` is only called conditionally. When no `SENTRY_DSN` is set, the error handler with `showDialog: true` will still attempt to display a Sentry crash-report dialog on every error, which won't function correctly without an initialized client. These providers should be registered conditionally (matching the initialization guard), or use a fallback `ErrorHandler` when Sentry is not active.</comment>

<file context>
@@ -1,12 +1,91 @@
+		LoggerService,
+		Store,
+		{
+			provide: ErrorHandler,
+			useValue: Sentry.createErrorHandler({
+				showDialog: true
</file context>
Fix with Cubic


import { enableProdMode } from '@angular/core';
import { platformBrowser } from '@angular/platform-browser';
import { HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 7, 2026

Choose a reason for hiding this comment

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

P2: Sentry providers (Sentry.createErrorHandler, Sentry.TraceService) are registered unconditionally, but initializeSentry() is only called when a valid SENTRY_DSN is present. When Sentry is not initialized, createErrorHandler becomes the active ErrorHandler (overriding ErrorHandlerService) but won't actually report errors to Sentry. Consider conditionally registering these providers, or at minimum ensure the error handler gracefully falls back when Sentry is not initialized.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/agent/src/main.ts, line 189:

<comment>Sentry providers (`Sentry.createErrorHandler`, `Sentry.TraceService`) are registered unconditionally, but `initializeSentry()` is only called when a valid `SENTRY_DSN` is present. When Sentry is not initialized, `createErrorHandler` becomes the active `ErrorHandler` (overriding `ErrorHandlerService`) but won't actually report errors to Sentry. Consider conditionally registering these providers, or at minimum ensure the error handler gracefully falls back when Sentry is not initialized.</comment>

<file context>
@@ -19,9 +92,136 @@ akitaConfig({
+			multi: true
+		},
+		{
+			provide: ErrorHandler,
+			useClass: ErrorHandlerService
+		},
</file context>
Fix with Cubic

@nx-cloud
Copy link

nx-cloud bot commented Feb 7, 2026

View your CI Pipeline Execution ↗ for commit a64f7ed

Command Status Duration Result
nx build desktop --base-href ./ ✅ Succeeded 2s View ↗
nx build desktop-api --output-path=dist/apps/de... ✅ Succeeded <1s View ↗
nx run api:desktop-api ✅ Succeeded 9s View ↗
nx run gauzy:desktop-ui --base-href ./ ✅ Succeeded 3m 32s View ↗
nx build gauzy -c=production --prod --verbose ✅ Succeeded 1m 8s View ↗
nx run-many -t build -c production -p constants... ✅ Succeeded 10s View ↗
nx run-many -t build -c development -p constant... ✅ Succeeded 10s View ↗
nx build api -c=production --prod ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-07 10:00:18 UTC

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.

4 participants