core icon indicating copy to clipboard operation
core copied to clipboard

34420 unify component

Open nicobytes opened this issue 5 months ago • 15 comments

This pull request introduces significant updates to the handling and testing of binary fields (file/image uploads) in the content editing experience. The main focus is on unifying the binary field implementation under the new dot-edit-content-file-field component, updating related imports and tests, and improving Playwright E2E test coverage for both the new and legacy editors. The changes also include new and refactored E2E test helpers for binary fields, and adjustments to test data and selectors.

Component and Module Refactoring:

  • The binary field implementation is unified under the dot-edit-content-file-field component, replacing the previous dot-edit-content-binary-field and its wrapper throughout the app and tests. This includes updating Angular module imports, dependency injection, and testbed configuration to use the new component and its bridge (DotBinaryFieldCeBridgeComponent). [1] [2] [3] [4] [5] [6] [7] [8]

E2E Test Enhancements:

  • Adds comprehensive Playwright E2E tests for the binary field image editor in both the new and legacy editors, including creation of content types, file import, and image editing workflows.
  • Introduces new E2E page objects for the legacy content editor and binary field, improving test structure and maintainability. [1] [2] [3]

Test Helper Improvements:

  • Refactors and extends the binary field test helper to support new selectors, actions (like image upload and editor opening), and improved assertions for button visibility and file handling. [1] [2] [3] [4] [5]

Test Data and Selector Updates:

  • Updates the default import-from-URL image to a stable 800x800 PNG for more robust image editor testing.
  • Aligns data-testid and DOM selectors in helpers with the new unified binary field implementation.

These changes collectively modernize the binary field experience, improve test coverage and reliability, and streamline the codebase for future enhancements.

This PR fixes: #34420

nicobytes avatar Jun 15 '26 17:06 nicobytes

Claude finished @erickgonzalez's task in 1m 9s —— View job


Rollback Safety Analysis

  • [x] Read rollback-unsafe categories reference
  • [x] Get full PR diff
  • [x] Analyze diff against unsafe categories
  • [x] Post findings / add label

Result: ✅ Safe to Rollback

Label added: AI: Safe To Rollback

Analysis

All changed files fall into two categories: frontend TypeScript/Angular and a Language.properties addition. Neither touches any rollback-unsafe category.

Category Finding
C-1 Structural data model change ❌ No runonce tasks, no schema changes
C-2 Elasticsearch mapping change ❌ No ESMappingAPIImpl / ESMappingConstants changes
C-3 Content JSON model version bump ❌ No ImmutableContentlet / CURRENT_MODEL_VERSION changes
C-4 DROP TABLE / DROP COLUMN ❌ No SQL drop statements
H-1 One-way data migration ❌ No data transformation tasks
H-2 RENAME TABLE / RENAME COLUMN ❌ None
H-3 PK restructuring ❌ None
H-4 New content field type (Java) ❌ No new Java Field implementations registered
H-5 Binary storage provider change ❌ No FileStorageAPIImpl / StoragePersistenceProvider changes
H-6 DROP PROCEDURE / FUNCTION ❌ None
H-7 NOT NULL column without default ❌ No schema changes
H-8 VTL viewtool contract change ❌ No viewtool classes modified
M-1 Non-broadening column type change ❌ None
M-2 Push publishing bundle format ❌ None
M-3 REST / GraphQL API contract change ❌ No REST endpoint or response shape changes
M-4 OSGi public interface change ❌ None

Summary

The PR is a pure frontend refactor: it removes the legacy dot-edit-content-binary-field Angular component and replaces it with dot-edit-content-file-field / DotBinaryFieldCeBridgeComponent. Backend changes are limited to three new i18n key additions in Language.properties (additive-only). There are no database migrations, no Elasticsearch mapping changes, no Java API contract changes, and no data transformations. Rolling back to the previous release would simply restore the old Angular components — no database or index recovery needed.

claude[bot] avatar Jun 15 '26 17:06 claude[bot]

🤖 Codex Review — openai.gpt-5.5

**[> [🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/binary-field.spec.ts:184 — The test now always expects the dotAI button to be disabled, but the removed isAiButtonEnabled()/test.skip(...) guard handled environments where the dotAI plugin is installed. This makes the suite fail in plugin-enabled environments even though the behavior is valid there.


Run: #27565980035 · tokens: in: 19850 · out: 3914 (reasoning: 3814) · total: 23764

github-actions[bot] avatar Jun 15 '26 17:06 github-actions[bot]

🤖 Bedrock Review — deepseek.v3.2

[🟡 Medium] core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:1-57 — DotWorkflowActionsFireService added as provider but not used in the module. This adds unnecessary dependency overhead.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/pages/legacyEditContentForm.page.ts:14-26 — matchingFrames.at(-1) assumes the last matching frame is the correct one; could be fragile if multiple frames match the pattern. Should include a more specific selector or validation.

[🟠 High] core-web/apps/dotcms-ui-e2e/src/tests/content-search/portlet-integrity.spec.ts:70-84 — Intercepting POST to **/api/content/_search with a mock response could mask actual API failures in the test. Should at least verify the request was made with correct parameters.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/helpers/binary-field.ts:77-90 — expectAiButtonDisabledWithTooltipWhenApplicable() silently returns if button is enabled; test could pass incorrectly if AI is enabled but tooltip behavior is broken. Should log or assert the expected state.

[🟡 Medium] core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:67-92 — getAll() returns Observable<void> but also calls subscribe() internally for backward compatibility. This dual behavior could cause confusion or double subscriptions. Consider deprecating the side effect.

[🟡 Medium] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.ts:103-176 — Binary, File, and Image fields all emit onBinaryFieldValueUpdated($event). Ensure the event payload is consistent across field types; otherwise, type safety could be broken.

[🟠 High] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.spec.ts:183-201 — Binary field test configuration now uses DotEditContentFileFieldComponent but provides a mock DotFileFieldUploadService with an empty object {}. This may not satisfy the service's dependencies, potentially causing test failures.

[🔴 Critical] core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-editor/dot-binary-field-editor.component.html — File deleted without apparent migration path. If this component was used elsewhere, it could break functionality. Verify no other references exist.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/relationship-field.ts:151-195 — dragRowToPosition() uses hardcoded steps: 10 in mouse movement; may not be reliable across different environments or CI speeds. Consider making it configurable or using Playwright's drag-and-drop utilities.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/utils/contentListingNavigation.ts:56-63 — clickAddNewContentFromList() uses expect(...).toPass() with a 20-second timeout for the entire retry loop, but each attempt has its own 2-second timeouts. Could lead to flaky tests if the menu is slow; consider increasing the inner timeouts or using a single robust wait.


Run: #28004093436 · tokens: in: 21306 · out: 771 · total: 22077

github-actions[bot] avatar Jun 16 '26 09:06 github-actions[bot]

@copilot resolve the merge conflicts in this pull request

nicobytes avatar Jun 16 '26 15:06 nicobytes

@copilot resolve the merge conflicts in this pull request

Resolved in bc5deab.

Copilot avatar Jun 16 '26 15:06 Copilot

Legal Risk

The following dependencies were released under a license that has been flagged by your organization for consideration.

Recommendation

While merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue.

GPL-2.0

MPL-2.0

semgrep-dotcms[bot] avatar Jun 16 '26 15:06 semgrep-dotcms[bot]

Manual QA — Unified File/Binary/Image fields

PR: #36172 · Fixes: #34420
Scope: Binary field is now rendered via the unified dot-edit-content-file-field stack (same UI as File/Image). Key regressions to watch: upload/save/reload, import from URL, Edit image (Binary + image only), remove confirmation, required validation, and image editor in CE2 vs legacy.

Important — Binary field must be tested in BOTH editors

Editor How to enable Where to open content
New editor (CE2) CONTENT_EDITOR2_ENABLED = true (default) Content → New → Angular edit form (#/content/...)
Old editor (CE1 / legacy) CONTENT_EDITOR2_ENABLED = false on the Content Type Content listing → New → Dojo iframe form

All Binary TCs marked [CE2 + Legacy] must be executed twice — once per editor. File and Image fields are CE2 only in this plan.

Build: branch 34420-unify-component (or QA build from this PR)


Setup

Item Detail
Access dotAdmin, user with Content Type + content permissions
Workflow System Workflow on all test Content Types

Create 4 Content Types for Binary (2 editors × optional/required) + File + Image:

Content Type Field Variable CE2 Required
QA Binary (new editor) Binary binaryField ✅ enabled No
QA Binary required (new editor) Binary binaryField ✅ enabled Yes
QA Binary (old editor) Binary binaryField ❌ disabled No
QA File File fileField ✅ enabled No (+ required variant)
QA Image Image imageField ✅ enabled No (+ required variant)

Test data

  • Text file: any .txt with content dotCMS E2E test file content
  • Image file: any small .png
  • Import URL: https://placehold.co/800x800.png

Expected copy

Context Text
Required empty This field is mandatory
Remove confirm Are you sure you want to remove this file?
dotAI disabled tooltip Please configure dotAI to enable this feature
Must NOT appear Something went wrong

🔴 Critical (run first)

Binary field — new editor (CE2)

  • [ ] TC-BIN-001 — Upload, save, reload [CE2]
    New content → upload .txt → preview visible → Save → reopen contentlet → preview still shows file content (dotCMS E2E test file content).

  • [ ] TC-BIN-003 — Required validation [CE2]
    Required Binary CT → fill Title only → Save → stays on form, error This field is mandatory under Binary.

  • [ ] TC-BIN-008 — Edit image [CE2 only]
    Import https://placehold.co/800x800.png → Edit image visible → click → PrimeNG dialog opens → legacy editor iframe loads inside dialog.

Binary field — old editor (legacy / CE1)

  • [ ] TC-BIN-001-L — Upload, save, reload [Legacy]
    Same as TC-BIN-001 but using the old editor Content Type (CONTENT_EDITOR2_ENABLED = false).

  • [ ] TC-BIN-003-L — Required validation [Legacy]
    Same as TC-BIN-003 in the old editor form.

  • [ ] TC-BIN-009 — Edit image [Legacy only]
    Import https://placehold.co/800x800.png → Edit image → Dojo #dotImageDialog opens with image tool iframe (not the CE2 PrimeNG dialog).

File field [CE2 only]

  • [ ] TC-FILE-001 — Upload, save, reload
    Upload .txt → Save → reopen → preview + file content still present.

  • [ ] TC-FILE-003 — Import from URL
    Import from URL → paste https://placehold.co/800x800.png → Import → preview visible, no error toast/400.

  • [ ] TC-FILE-005 — Required validation
    Required File empty → Save blocked with This field is mandatory.

Image field [CE2 only]

  • [ ] TC-IMG-001 — Upload, save, reload
    Upload .png → Save → reopen → preview + thumbnail visible, filename shown in metadata.

  • [ ] TC-IMG-003 — Required validation
    Required Image empty → Save blocked with This field is mandatory.


🟡 Regression (field-type rules & UX)

Binary field — run in both editors unless noted

  • [ ] TC-BIN-002 — Import from URL [CE2 + Legacy]
    Import image URL → preview/thumbnail without errors.

  • [ ] TC-BIN-004 — No Edit image for text file [CE2 + Legacy]
    Upload .txt → preview visible → Edit image must not appear.

  • [ ] TC-BIN-005 — Remove with confirmation [CE2 + Legacy]
    Upload file → Remove → confirm popup Are you sure you want to remove this file? → Remove → preview cleared, dropzone back.

  • [ ] TC-BIN-006 — Edit existing content (hydration) [CE2 + Legacy]
    Save contentlet with imported image → reopen → preview + thumbnail visible, no Something went wrong.

  • [ ] TC-BIN-007 — dotAI tooltip [CE2 + Legacy] (N/A if dotAI is configured)
    Generate With dotAI disabled → hover → tooltip Please configure dotAI to enable this feature.

File field [CE2 only]

  • [ ] TC-FILE-002 — Import dialog UI
    Import from URL → dialog shows URL input, Cancel, Import, Close (X) → X closes dialog.

  • [ ] TC-FILE-004 — No Edit image on File field
    Import image URL into File field → preview visible → Edit image must not appear.

Image field [CE2 only]

  • [ ] TC-IMG-002 — No Edit image on Image field
    Upload .png → Edit image must not appear (editor is Binary-only).

🟢 Smoke

  • [ ] TC-IMG-004 — Image field actions [CE2 only]
    Empty Image field dropzone → Generate With dotAI visible → Create New File hidden.

E2E coverage map

Manual ID Editor Playwright spec
TC-BIN-001…007 CE2 binary-field.spec.ts
TC-BIN-008 CE2 binary-field-image-editor.spec.ts (new editor)
TC-BIN-009 / TC-BIN-*-L Legacy binary-field-image-editor.spec.ts (legacy editor)
TC-FILE-001…005 CE2 file-field.spec.ts
TC-IMG-001…004 CE2 image-field.spec.ts

Bug report template

Please include: TC-ID, editor (CE2 / Legacy), Content Type + field variable, steps, expected vs actual, screenshot, browser, instance URL/version.

Tester: _______________ · Date: _______________ · Result: ☐ Pass all critical · ☐ Failures (list TC-IDs + editor)

nicobytes avatar Jun 16 '26 20:06 nicobytes

@copilot resolve the merge conflicts in this pull request

nicobytes avatar Jun 17 '26 15:06 nicobytes

@copilot resolve the merge conflicts in this pull request

Resolved in baa2b30.

Copilot avatar Jun 17 '26 16:06 Copilot

Bug 1: UI Layout Overflow & Missing Edit Option when is a txt file

Editor: Both

Content Type: QA Binary / QA Binary required

Description: There is a visual discrepancy between the demo and the current branch. When creating new content, the content overflows outside the field container boundaries. Additionally, the option to edit the binary field is missing ( I cannot click on it to edit it ) when we are uploading a txt file. Note: This mostly happens during creation Screenshot 2026-06-17 at 3 16 28 PM

Steps to Reproduce:

  • Go to Content → New → Select Binary field.

  • Add a Txt file and try to edit it by clicking

Expected Result: The container fits the field elements properly within its boundaries (no text/content overflow). The option to edit the binary field should be accessible if applicable.

**Bug 2: False Positive "Required" Validation on Binary Field **

Editor: Old Editor

Content Type: Binary required

Description: The binary field triggers a false "This field is mandatory" validation error upon saving, even though a valid file has already been uploaded/added into the field.

Steps to Reproduce:

  • Go to Content → New → Select Binary field.
  • Try to add a file and save it
image

Expected Result: The contentlet saves successfully since all required fields (Binary field) contain data.

Bug 3: Binary Field Content Not Saving / Dropping Hydration Related TC: TC-BIN-001 / TC-BIN-006 — Edit existing content (hydration)

Editor: Old editors

Content Type: Binary Description: When adding a binary file to a binary field the file data fails to persist. Upon saving and reloading, the field reverts to an empty state. (Only when creating)

https://github.com/user-attachments/assets/8ee4f22a-d1f1-442d-9952-9591f49216fc

Steps to Reproduce:

  • Open Content → New → Binary

  • Upload a file to the non-required binaryField.

  • Click Save.

  • Reopen the newly created contentlet.

Expected Result: The contentlet reopens with the binary file fully hydrated (preview and filename visible, no data loss).

Bug 4: Image Editor Preview Synchronization Delay on Empty Fields

Editor: Both editors

Content Type: Binary

Description: When interacting with the Image Editor on a brand-new/empty binary field, modifications made inside the PrimeNG dialog editor do not sync back to the main form preview in real-time.

https://github.com/user-attachments/assets/7da2cc56-1e15-4ba0-9ae0-6505cde4b0b2

Steps to Reproduce:

  • Open Content → New → Binary

  • Upload a small image or import via URL to an empty binary field.

  • Click on Edit image to open the PrimeNG dialog editor.

  • Apply any modification/crop inside the editor and confirm changes.

  • Check the field preview on the main form before saving.

Expected Result: The modified image steps should immediately reflect on the form's preview container prior to hitting the final save button.

Aditional UI issue: The field icons collide with the command bar.

Screenshot 2026-06-17 at 3 31 22 PM

adrianjm-dotCMS avatar Jun 17 '26 19:06 adrianjm-dotCMS

🤖 Bedrock Review — us.deepseek.r1-v1:0

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — provideAppInitializer uses inject() outside valid injection context, causing runtime error. Angular's inject() cannot be used in provider factories before application injector is available.
  • 🔴 Critical: core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:74 — init() returns Observable but callers (like app initializer) assume synchronous completion. Risk of race condition where messages aren't loaded before components render.

Existing

  • 🟡 Medium: core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/relationship-field.ts:156 — Custom drag simulation via mouse events may flake in CI. Consider Playwright's locator.dragTo() for reliability (pre-existing test fragility).

Resolved

  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/login/translations.spec.ts:31 — Fixed assertion using Playwright's expect instead of Node assert.

Run: #28056846465 · tokens: in: 21960 · out: 1579 · total: 23539

github-actions[bot] avatar Jun 23 '26 21:06 github-actions[bot]

🤖 Bedrock Review — us.deepseek.r1-v1:0

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — Invalid use of inject() in provideAppInitializer. Angular initializer functions execute before the injector is fully configured, causing runtime errors when using inject() directly.

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — Invalid use of inject() in provideAppInitializer causes runtime error (unchanged)

Resolved

  • ✅ core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:74 — init() now returns completing Observable with take(1), allowing firstValueFrom to work
  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/relationship-field.ts:156 — Replaced custom drag simulation with Playwright's built-in mouse API

Run: #28058374061 · tokens: in: 22106 · out: 975 · total: 23081

github-actions[bot] avatar Jun 23 '26 21:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject() is used inside provideAppInitializer(), which executes before the injector is fully configured, causing runtime errors when DotMessageService is injected. This is a known Angular anti-pattern and matches the prior review finding.

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — Prior finding still present: inject() in provideAppInitializer remains unmodified and still breaks injector initialization.

Resolved

  • ✅ core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — No, the prior issue was not resolved; the code still uses inject() inside provideAppInitializer.

Run: #28173503266 · tokens: in: 21071 · out: 233 · total: 21304

github-actions[bot] avatar Jun 25 '26 13:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() is called before the injector is fully configured, causing runtime errors during app bootstrap. This is identical to the prior critical finding and was not fixed — the same pattern persists.

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — prior finding still present: inject() used inside provideAppInitializer() before injector is fully configured, causing runtime errors

Resolved

  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts — deleted file no longer relevant

Run: #28182156211 · tokens: in: 21047 · out: 232 · total: 21279

github-actions[bot] avatar Jun 25 '26 15:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() is called before the injector is fully configured, causing runtime errors during app bootstrap. This is identical to the prior critical finding and was not fixed — the change only wrapped init() in firstValueFrom, but the injection timing issue remains.

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — prior finding still present: injecting DotMessageService inside provideAppInitializer() before injector is fully configured causes bootstrap failure.

Resolved

  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts — deleted file, no longer relevant

Run: #28198643388 · tokens: in: 21059 · out: 249 · total: 21308

github-actions[bot] avatar Jun 25 '26 20:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() is called before the injector is fully configured, causing runtime errors during app bootstrap. This is identical to the prior critical finding and was not fixed — the same pattern persists.

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — prior finding still present: inject(DotMessageService) inside provideAppInitializer() before injector is fully configured, causing runtime errors during app bootstrap

Resolved

  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts — deleted file no longer relevant

Run: #28254635933 · tokens: in: 20876 · out: 238 · total: 21114

github-actions[bot] avatar Jun 26 '26 17:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() is still present and unmodified; this causes runtime errors during app bootstrap because the injector is not fully configured when provideAppInitializer runs, violating Angular’s bootstrap lifecycle. The prior finding was explicitly flagged and remains unaddressed.

Existing

  • 🟡 Medium: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — prior finding still present (unchanged or incomplete fix)

Resolved

  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts — deleted file, no longer applicable
  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/binary-field.spec.ts — renamed and refactored; test logic migrated to new structure
  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-field/file-field.spec.ts — refactored to use test.describe with beforeEach/afterEach; no longer has global state leakage
  • ✅ core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:29 — init() now returns Observable<void> and uses shareReplay + take(1) for backward compatibility; race condition on concurrent init() calls resolved
  • ✅ core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.spec.ts:57 — test now uses firstValueFrom() to await async init; no longer ignores observable

Run: #28255543802 · tokens: in: 20876 · out: 473 · total: 21349

github-actions[bot] avatar Jun 26 '26 17:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — firstValueFrom(dotMessageService.init()) is called inside provideAppInitializer(), but init() returns an Observable<void> that emits only after HTTP or localStorage resolution. This blocks Angular bootstrap until the observable completes — which may never complete if the HTTP call fails, hangs, or if the app is offline. No timeout, retry, or fallback is implemented. Bootstrap hangs indefinitely on network failure or misconfigured backend.
  • 🟠 High: core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:67 — getAll() returns of(void 0) when messages are in localStorage, but the messageMap assignment is outside the observable chain. If shouldReloadMessages() is false, messageMap is set from localStorage, but the returned Observable<void> emits immediately — yet the HTTP call is never made to update messages on build change. This breaks message refresh on app updates. The observable chain is broken: of(void 0) emits before messageMap is updated from HTTP, and the HTTP path never completes the observable if it fails.
  • 🟡 Medium: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — provideAppInitializer() uses firstValueFrom() on a non-terminating observable. If init() emits multiple values (e.g., due to race or bug), firstValueFrom() will resolve on the first, but the observable may still be active and cause side effects later. This is not a bug yet, but violates the contract of AppInitializer — which expects synchronous or single-emitting initialization. What to verify: Does DotMessageService.init() ever emit more than once? If yes, this causes unpredictable behavior.

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() before injector is fully configured, causing runtime errors during app bootstrap — still present. The inject() call inside provideAppInitializer() runs before the injector is fully initialized, which is a known Angular bug pattern. This is not fixed by the current diff — it was already flagged and remains broken.

Resolved

  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts — deleted file, replaced by file-upload-fields variant with proper inheritance and logic. No longer relevant.
  • ✅ core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/binary-field.spec.ts — refactored to use NewEditContentFormPage and BinaryField from new location. Test logic preserved, no regression.
  • ✅ core-web/libs/edit-content/src/index.ts — export path updated to new component location. No longer references deleted DotEditContentBinaryFieldComponent.

Run: #28260483757 · tokens: in: 20950 · out: 872 · total: 21822

github-actions[bot] avatar Jun 26 '26 19:06 github-actions[bot]

🤖 Bedrock Review — qwen.qwen3-next-80b-a3b

New Issues

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — firstValueFrom(dotMessageService.init()) blocks Angular bootstrap indefinitely on HTTP failure or network issues with no timeout or fallback
  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() before injector is fully configured, causing runtime errors during app bootstrap
  • 🟠 High: core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:67 — getAll() returns of(void 0) when messages are in localStorage, but messageMap is set outside the observable chain — breaks message refresh on build change

Existing

  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — firstValueFrom(dotMessageService.init()) blocks Angular bootstrap indefinitely on HTTP failure or network issues with no timeout or fallback
  • 🟠 High: core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:67 — getAll() returns of(void 0) when messages are in localStorage, but messageMap is set outside the observable chain — breaks message refresh on build change
  • 🟡 Medium: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — provideAppInitializer() uses firstValueFrom() on a non-terminating observable — may cause side effects if init() emits multiple values
  • 🔴 Critical: core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — inject(DotMessageService) inside provideAppInitializer() before injector is fully configured, causing runtime errors during app bootstrap

Resolved

  • ✅ core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts:49 — provideAppInitializer() now wraps firstValueFrom() in a function, but the underlying issues remain unaddressed (see above)
  • ✅ core-web/libs/data-access/src/lib/dot-messages/dot-messages.service.ts:67 — getAll() now returns an Observable<void>, but the messageMap assignment outside the observable chain persists — this was not fixed

Run: #28263776761 · tokens: in: 21200 · out: 886 · total: 22086

github-actions[bot] avatar Jun 26 '26 20:06 github-actions[bot]

🤖 dotBot Review (Bedrock)

Reviewed 33 file(s); 12 candidate(s) → 8 confirmed, 2 uncertain (unverified, kept for review).

⚠️ Coverage capped: 0 file(s) + 19 lower-severity candidate(s) skipped (limits: 40 files, 12 candidates).

Confirmed findings

  • 🟠 High core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/binary-field.spec.ts:62 — Incorrect admin path in E2E test navigation The test uses /dotAdmin/#/content/... URL path but dotCMS admin paths typically use /html/ base. This would cause navigation failures in the E2E test as the correct path should be /html/....
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/pages/newEditContentForm.page.ts:13 — Potential race condition due to removed domcontentloaded wait The removal of page.waitForLoadState('domcontentloaded') in newEditContentForm.page.ts without ensuring the goToEditContent utility handles page readiness could lead to race conditions. While goToEditContentlet performs Angular router navigation, Playwright E2E tests require explicit waits for client-side rendered elements. The current implementation lacks a wait for the binary field component to be interactive after navigation, risking flaky tests when elements aren't ready.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/pages/newEditContentForm.page.ts:20 — Potential test flakiness from removed synchronization The removal of Dojo-specific waits (waitForDojoToBeReady) and forceClick in newEditContentForm.page.ts eliminates synchronization points that may have been compensating for animation/rendering delays. While Playwright has auto-waiting, the test structure shown doesn't demonstrate replacement waits for the new component's render patterns, creating risk of race conditions in CI environments.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/tests/content-search/helpers/content-listing.ts:113 — Non-unique selector for API link in test The selector '.dot-api-link' in content-listing.ts line 113 uses a class that's part of the dot-api-link Angular component's template (rendered as ). While current usage appears limited to 1 instance per view, this class-based selector is fragile against component template changes. Safer to use component tag selector 'dot-api-link' or a data-testid attribute for E2E stability.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/binary-field.spec.ts:65 — Fixed timeout in E2E test may cause flakiness The test uses a fixed 15-second timeout for checking title visibility. While this might work in some environments, it introduces flakiness in slower CI/CD pipelines or under heavy load. Playwright's default timeout (30s) would be more reliable, and explicit waits should generally be avoided unless necessary for specific slow operations.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/binary-field.spec.ts:181 — AI button test may fail when plugin is not installed The test expects the AI button to be visible without verifying if the required plugin is installed. This could lead to false test failures in environments without the AI plugin. The assertion expect(aiButton).toBeVisible() will fail if the plugin isn't present, but the test doesn't include setup steps to ensure plugin availability.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/helpers/binary-field.ts:27 — Incomplete success check in upload response The test helper checks for HTTP 200 status but doesn't validate response content. The /api/v1/workflow/actions/default/fire/PUBLISH endpoint returns 200 even when content validation fails (e.g., required file missing), with errors in the response body. This could lead to false-positive test passes where publish appears successful despite upload failures.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/helpers/binary-field.ts:67 — Missing timeout in page.waitForResponse for /byUrl endpoint The page.waitForResponse call in binary-field.ts line 67 lacks a timeout parameter. While Playwright's default 30s timeout would eventually fail, explicit timeouts improve test reliability. This could lead to prolonged test execution if the endpoint hangs, particularly in CI environments where resource limits exist.

🔎 Uncertain (could not confirm or disprove — review manually)

  • 🟠 High core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.spec.ts:197 — Potential form control registration conflict for binary field The removal of 'outsideFormControl: true' in BINARY field configuration (line 197) suggests parent form now manages control, but without seeing DotEditContentFileFieldComponent's implementation, we can't confirm if this creates duplication. Requires manual verification of component's form control integration strategy.
  • 🟡 Medium core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-upload-fields/binary-field/binary-field-system-options.spec.ts:19 — System options JSON keys may mismatch backend expectations The test uses camelCase keys (allowedContentTypes, maxFiles) which might not align with backend expectations (e.g. snake_case). Without access to backend field configuration code, it's unclear if these keys match the expected format. E2E tests may pass even if keys are incorrect if assertions don't validate the actual system behavior.

us.deepseek.r1-v1:0 · Run: #28407741326 · tokens: in: 177314 · out: 45317 · total: 222631 · calls: 55 · est. ~$0.484

github-actions[bot] avatar Jun 26 '26 21:06 github-actions[bot]