Repository navigation
docs: correct how the SSE push transport fails when disabled - #6766
Conversation
Distinguish the startup failure for @Push(transport = SERVER_SENT_EVENTS) on the application shell or a web component exporter from the DisabledFeatureException thrown by PushConfiguration.setTransport(), on the Server Push reference page. Documents vaadin/flow#27195 (`9614500cd03b24724b2ca9bdd7a273d91f063436`).
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6766.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Built from ef5e555 |
vaadin-review-bot
left a comment
There was a problem hiding this comment.
Reviewed the changes — left 3 comments.
| Finding | |
|---|---|
| The startup error doesn't name the class for a web component exporter | |
| 💬 | The exception thrown at startup isn't named |
| 📐 | The first sentence is 41 words with an aside that splits subject from verb |
| This transport is experimental and requires enabling the `ssePushTransport` feature flag; see <<{articles}/flow/configuration/feature-flags#,Feature Flags>>. Selecting it while the feature flag is disabled throws a `DisabledFeatureException`. | ||
| This transport is experimental and requires enabling the `ssePushTransport` feature flag; see <<{articles}/flow/configuration/feature-flags#,Feature Flags>>. | ||
|
|
||
| Selecting it in a `@Push` annotation -- on the application shell, or on a <<{articles}/flow/integrations/embedding/push#,web component exporter>> -- while the feature flag is disabled prevents the application from starting, with an error that names the annotated class and how to enable the flag. Selecting it by calling [methodname]`PushConfiguration.setTransport()` while the feature flag is disabled throws a `DisabledFeatureException` instead. |
There was a problem hiding this comment.
The new sentence says the startup error "names the annotated class" for both locations, but for an exporter the message only says a web component exporter.
WebComponentConfigurationRegistryInitializer.java:93-94 passes the literal string "a web component exporter" as the owner, while VaadinAppShellInitializer.java:164-165 passes "the app shell " + shell.getName(). The test at WebComponentConfigurationRegistryInitializerTest.java:168 asserts only on "web component exporter".
Suggested fix: drop the claim about the class name, for example "…prevents the application from starting, with an error that says where the annotation is and how to enable the flag."
server-push.adoc:121 · accuracy
There was a problem hiding this comment.
Fixed. The claim about the class name is gone. The text now says the message says where the annotation is and how to enable the flag.
| This transport is experimental and requires enabling the `ssePushTransport` feature flag; see <<{articles}/flow/configuration/feature-flags#,Feature Flags>>. Selecting it while the feature flag is disabled throws a `DisabledFeatureException`. | ||
| This transport is experimental and requires enabling the `ssePushTransport` feature flag; see <<{articles}/flow/configuration/feature-flags#,Feature Flags>>. | ||
|
|
||
| Selecting it in a `@Push` annotation -- on the application shell, or on a <<{articles}/flow/integrations/embedding/push#,web component exporter>> -- while the feature flag is disabled prevents the application from starting, with an error that names the annotated class and how to enable the flag. Selecting it by calling [methodname]`PushConfiguration.setTransport()` while the feature flag is disabled throws a `DisabledFeatureException` instead. |
There was a problem hiding this comment.
💬 The exception thrown at startup isn't named
The paragraph names DisabledFeatureException for the PushConfiguration path but describes the annotation path only as "prevents the application from starting, with an error". The exception is [classname]InvalidApplicationConfigurationException (PushUtil.java:86).
A developer whose application fails to start searches the stack trace's exception name in the docs and finds nothing on the page that covers exactly this case. Naming it costs two words:
…prevents the application from starting with an [classname]
InvalidApplicationConfigurationException, whose message says…
server-push.adoc:121 · clarity
There was a problem hiding this comment.
Fixed. The paragraph now names InvalidApplicationConfigurationException as the exception that stops the application from starting.
| This transport is experimental and requires enabling the `ssePushTransport` feature flag; see <<{articles}/flow/configuration/feature-flags#,Feature Flags>>. Selecting it while the feature flag is disabled throws a `DisabledFeatureException`. | ||
| This transport is experimental and requires enabling the `ssePushTransport` feature flag; see <<{articles}/flow/configuration/feature-flags#,Feature Flags>>. | ||
|
|
||
| Selecting it in a `@Push` annotation -- on the application shell, or on a <<{articles}/flow/integrations/embedding/push#,web component exporter>> -- while the feature flag is disabled prevents the application from starting, with an error that names the annotated class and how to enable the flag. Selecting it by calling [methodname]`PushConfiguration.setTransport()` while the feature flag is disabled throws a `DisabledFeatureException` instead. |
There was a problem hiding this comment.
📐 The first sentence is 41 words with an aside that splits subject from verb
CONVENTIONS.md: "When a sentence that you add or change is too long, split it. Give an aside or an example its own sentence." Vale's threshold is 30 words; this sentence has about 41, and the -- aside puts 13 words between "Selecting it in a @Push annotation" and the verb "prevents".
Suggested split:
A
@Pushannotation can select this transport on the application shell, or on a <<{articles}/flow/integrations/embedding/push#,web component exporter>>. While the feature flag is disabled, either one prevents the application from starting.
server-push.adoc:121 · conventions
There was a problem hiding this comment.
Split as suggested. One sentence says where @Push can select the transport. The next says what happens while the flag is disabled, and a third covers the message.
The startup error names the class only for the app shell; for a web component exporter it just says "a web component exporter". Name the InvalidApplicationConfigurationException it throws.
Documentation for vaadin/flow#27195 by
@totally-not-ai[bot].Note
The source pull request is merged, so this documentation describes the final
shape of the change. Please review it and mark it ready for review.
Change categories: BEHAVIOR_CHANGE
articles/flow/advanced/server-push.adocDisabledFeatureException. That's still true forPushConfiguration.setTransport(), but a@Push(transport = Transport.SERVER_SENT_EVENTS)annotation on the application shell or a web component exporter now fails application startup instead, since the annotation is read before any UI exists. The paragraph now distinguishes the two cases, right above the code example it corrects.Auto-generated by the Documentation Bot — review before merging.