Skip to content

isBackgroundChange() is false for changes triggered by other users #23979

Closed

Description

@Legioth

Description of the bug

EffectContext.isBackgroundChange returns false for changes that are triggered by another user.

Expected behavior

Expected that changes from another user would be marked as background changes.

Minimal reproducible example

@Route
public class MainView extends VerticalLayout {
    private static final SharedValueSignal<Boolean> signal = new SharedValueSignal<>(true);

    public MainView() {
        Span span = new Span();
        span.bindText(() -> signal.get().toString()).onChange(context -> {
            System.out.println("Background change: " + context.isBackgroundChange());
        });
        add(span);

        add(new Button("Toggle from UI",click -> {
            signal.update(x -> !x);
        }));
        
        add(new Button("Toggle from background thread",click -> {
            Thread.startVirtualThread(() -> signal.update(x -> !x));
        }));
    }
}
  1. Open the same UI in two separate browsers so that they use separate sessions
  2. Click the "Toggle from UI" button
  3. Notice that Background change: false is printed twice. Expected to get one case with true and another with false.

Note that the "Toggle from background thread" button works as expected - changes triggered in that way are reported as background changes for both users.

Versions

  • Vaadin / Flow version: Vaadin 25.1.0-rc2

Activity

  1. added a commit that references this issue on Mar 24, 2026
    cebd74c
  2. added theissue type on Mar 25, 2026
  3. moved this to 🔖 Normal Priority (P2) in Vaadin Flow bugs & maintenanceon Mar 25, 2026
  4. moved this from 🪵Product backlog to 🔎Iteration reviews in Vaadin Flow | Hilla | Kits ongoing workon Mar 25, 2026
  5. added a commit that references this issue on Mar 25, 2026
    2e87c74
  6. moved this from 🔖 Normal Priority (P2) to ✅ Closed in Vaadin Flow bugs & maintenanceon Mar 25, 2026
  7. added 2 commits that reference this issue on Mar 26, 2026
    be84166
    6702427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions