Skip to content

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Oct 1, 2025

Simplify JacksonCodec and JsonCodec by using Jackson for all type
deserialization instead of custom primitive type handling. This provides
consistent behavior and better error messages but removes lenient type
conversions (e.g., boolean to integer).

@vaadin-bot
Copy link
Collaborator

vaadin-bot commented Oct 1, 2025

TC Format Checker Report - 17:32 - 01 - Oct

BLOCKER There are 4 files with format errors

  • To see a complete report of formatting issues, download the differences file

  • To fix the build, please run mvn formatter:format in your branch and commit the changes.

  • Optionally you might add the following line in your .git/hooks/pre-commit file:

    mvn formatter:format
    

Here is the list of files with format issues in your PR:

flow-server/src/test/java/com/vaadin/flow/component/ComponentEventBusTest.java
flow-server/src/test/java/com/vaadin/flow/internal/JacksonCodecTest.java
flow-server/src/test/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandlerTest.java
flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/JavaScriptReturnValueIT.java

Simplify JacksonCodec and JsonCodec by using Jackson for all type
deserialization instead of custom primitive type handling. This provides
consistent behavior and better error messages but removes lenient type
conversions (e.g., boolean to integer).

Update tests to match Jackson's stricter type conversion behavior and
rename misleading test methods.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Artur- Artur- force-pushed the jackson-primitive branch from bd3726a to 5396b73 Compare October 1, 2025 11:27
Copy link

github-actions bot commented Oct 1, 2025

Test Results

1 206 files   -  62  1 206 suites   - 62   1h 13m 3s ⏱️ - 2m 55s
8 211 tests  - 478  8 143 ✅  - 479  66 💤  - 1  1 ❌ +1  1 🔥 +1 
8 675 runs   - 482  8 597 ✅  - 482  76 💤  - 2  1 ❌ +1  1 🔥 +1 

For more details on these failures and errors, see this check.

Results for commit e2b14a4. ± Comparison against base commit f0cacb7.

This pull request removes 480 and adds 2 tests. Note that renamed tests count towards both.
com.vaadin.base.devserver.AbstractDevServerRunnerTest ‑ shouldPassEncodedUrlToDevServer
com.vaadin.base.devserver.AbstractDevServerRunnerTest ‑ updateServerStartupEnvironment_preferIpv4_LocalhostIpAddressAddedToProcessEnvironment
com.vaadin.base.devserver.AbstractDevServerRunnerTest ‑ updateServerStartupEnvironment_preferIpv6_LocalhostIpAddressAddedToProcessEnvironment
com.vaadin.base.devserver.BrowserLiveReloadAccessorImplTest ‑ getLiveReload_devMode_contextHasNoReloadInstance_instanceIsCreated
com.vaadin.base.devserver.BrowserLiveReloadAccessorImplTest ‑ getLiveReload_devMode_contextHasReloadInstance_instanceIsReturned
com.vaadin.base.devserver.BrowserLiveReloadAccessorImplTest ‑ getLiveReload_liveReloadDisabled_instanceIsCreated
com.vaadin.base.devserver.BrowserLiveReloadAccessorImplTest ‑ getLiveReload_productionMode_nullIsReturned
com.vaadin.base.devserver.DebugWindowConnectionLicenseCheckTest ‑ checkLicense_invalidLicense_sendLicenseCheckFailed
com.vaadin.base.devserver.DebugWindowConnectionLicenseCheckTest ‑ checkLicense_noLicenseKeys_sendLicenseCheckFailed
com.vaadin.base.devserver.DebugWindowConnectionLicenseCheckTest ‑ checkLicense_validLicense_sendLicenseOk
…
com.vaadin.flow.component.ComponentEventBusTest ‑ mappedDomEvent_fire_missingData_shouldFail
com.vaadin.flow.server.communication.rpc.PublishedServerEventHandlerRpcHandlerTest ‑ nullValueShouldFailForPrimitive

♻️ This comment has been updated with latest results.

Artur- and others added 5 commits October 1, 2025 17:25
…rn values

Previously, JavaScript Error objects returned as success values would be
silently converted to empty strings when the Java callback expected String.class.
This was confusing and led to silent data loss.

Now Error objects that cannot be converted to the expected type properly
trigger the error handler with a clear exception message, providing better
debugging information and encouraging proper error handling.

Breaking change: Applications relying on Error objects becoming empty strings
will now receive error callbacks instead. This is intentional to improve
type safety and debugging.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updated comments in JavaScriptReturnValueIT to explain what the code does
and why, rather than referencing how it used to work vs how it works now.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…of silent conversion

Changed nullValueAreAcceptedForPrimitive test to nullValueShouldFailForPrimitive
to verify that passing null to primitive parameters correctly throws an exception
instead of silently converting to default values.

This maintains Jackson's strict type checking behavior which is better for
debugging and prevents silent data corruption.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…rimitive data

The mappedDomEvent_fire_missingData test now correctly expects that when
DOM event data is missing required primitive boolean fields, an exception
should be thrown rather than silently defaulting to false.

This maintains consistency with our fail-fast approach for type safety.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
All ComponentEventBusTest methods now provide complete event data including
required primitive boolean fields to prevent Jackson deserialization failures.

Added helper methods:
- createCompleteEventData(): Creates full event data with all required fields
- createMinimalEventData(): Creates minimal valid event data for tests that
  don't care about specific values

This maintains our fail-fast approach while ensuring tests properly simulate
realistic DOM event scenarios with complete data.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Artur- Artur- marked this pull request as ready for review October 1, 2025 17:28
Copy link

sonarqubecloud bot commented Oct 1, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants