Skip to content

SvelteMap reactivity not fully fixed by #13877 #13947

@gyzerok

Description

@gyzerok

Describe the bug

In #13877 there was a fix for SvelteMap, which fixed the original reported REPL, but was still a problem in our codebase. It seems I found what the issue is.

@trueadm fyi

Reproduction

Here is the REPL.

The difference is calling getAsync the second time in {@const value1 = cache.getAsync(id)}. This again ends up in the infinite loading state. In our case we are probably calling from some other place, but here I place it on the next line for the minimal repro purpose.

Relevant piece from the playground inline for your convenience

{#await id}
  Loading...
{:then id}
  {@const value = cache.getAsync(id)}
  {@const value1 = cache.getAsync(id)}

  {#if value instanceof Promise}
    Loading...
  {:else}
    {value}
  {/if}
{/await}

Logs

No response

System Info

irrelevant

Severity

annoyance

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