Skip to content

islands_router update & hydration issues #4854

Description

@antler5

Describe the bug
Incorrect updates (since Oct) and hydration bugs (since Nov) with component-erasure + islands-router (ie. mark-branches, etc?). I've extended the test in example islands_router to mount and increment Counter, and added a second variant showing how hydration kinda works between the Oct-Nov commits if we push through the distinct nav/update bug.

Leptos Dependencies

See examples/islands_router

To Reproduce

  1. Clone, pull, or save patched islands_router test
  2. Checkout or apply it
  3. cd examples/island_router
  4. (here i rebased onto alt commits to bisect)
  5. See errors / behavior
errors Since 61571ed, Nov 19 - present, the happy & redundant paths both fail:
 1) [chromium] › tests/navigation.spec.ts:16:5 › navigates from Home to About, increments Counter ─

    Error: expect(locator).not.toBeVisible() failed

    Locator:  getByText('Enter a search to begin viewing contacts.')
    Expected: not visible
    Received: visible
    Timeout:  5000ms

    Call log:
      - Expect "not toBeVisible" with timeout 5000ms
      - waiting for getByText('Enter a search to begin viewing contacts.')
        14 × locator resolved to <p class="note">…</p>
           - unexpected value "visible"

      27 |   await expect(page.locator("input[type=search]")).not.toBeAttached();
      28 |
    > 29 |   await expect(page.getByText("Enter a search to begin viewing contacts.")).not.toBeVisible();
         |                                                                                 ^
      30 |   await expect(page.locator("button[class=counter]")).toHaveText("Click Me: 0");
      31 |   await page.click('button[class=counter]');
      32 |   await expect(page.locator("button[class=counter]")).toHaveText("Click Me: 1");
 [...]

 2) [chromium] › tests/navigation.spec.ts:37:5 › navigates from Home to About (redundantly), increments Counter

    Error: expect(locator).toHaveText(expected) failed

    Locator:  locator('button[class=counter]')
    Expected: "Click Me: 1"
    Received: "Click Me: 0"
    Timeout:  5000ms

    Call log:
      - Expect "toHaveText" with timeout 5000ms
      - waiting for locator('button[class=counter]')
        14 × locator resolved to <button class="counter">…</button>
           - unexpected value "Click Me: 0"

      59 |   await expect(page.locator("button[class=counter]")).toHaveText("Click Me: 0");
      60 |   await page.click('button[class=counter]');
    > 61 |   await expect(page.locator("button[class=counter]")).toHaveText("Click Me: 1");
         |                                                       ^
      62 |
      63 |   expect(errors).toEqual([]);
      64 | });

Since b20903a, Oct 11, the happy-path fails and the redundant path succeeds:

 1) [chromium] › tests/navigation.spec.ts:16:5 › navigates from Home to About, increments Counter

    Error: expect(locator).not.toBeVisible() failed

    Locator:  getByText('Enter a search to begin viewing contacts.')
    Expected: not visible
    Received: visible
    Timeout:  5000ms

    Call log:
      - Expect "not toBeVisible" with timeout 5000ms
      - waiting for getByText('Enter a search to begin viewing contacts.')
        14 × locator resolved to <p class="note">…</p>
           - unexpected value "visible"

      27 |   await expect(page.locator("input[type=search]")).not.toBeAttached();
      28 |
    > 29 |   await expect(page.getByText("Enter a search to begin viewing contacts.")).not.toBeVisible();
         |                                                                                 ^
      30 |   await expect(page.locator("button[class=counter]")).toHaveText("Click Me: 0");
      31 |   await page.click('button[class=counter]');
      32 |   await expect(page.locator("button[class=counter]")).toHaveText("Click Me: 1");
 [...]

  ✓  2 …vigates from Home to About (redundantly), increments Counter (1.9s)

Before then, the results I would expect:

  ✓  1 …c.ts:16:5 › navigates from Home to About, increments Counter (1.2s)
  ✘  2 …vigates from Home to About (redundantly), increments Counter (5.3s)

Next Steps

  • I will make a PR
  • I would like to make a PR, but need help getting started
  • I want someone else to take the time to fix this
  • This is a low priority for me and is just shared for your information

Additional context
i continue teasing thru related code, but this appears to predate many otherwise related leads and i have not re-oriented 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions