Skip to content

Render race condition with MDCCached found with Nuxt Chat #384

@ChrisTowles

Description

@ChrisTowles

I've believed i found and tracked down an issue in MDCCached caused by the watch getting out of sync.

Reproduction

  • navigate to running the Nuxt UI chat-template
  • use one of the labels to start a chat and if first time rendered everything works.
  • now start a new chat using the same label
  • that chat response from cloudflare will be cached and return almost immediately.
  • the result will be the prop value and data will no longer match.
  • presents it self as no loading and no rendered visible text in the component.

Resolution

watch(() => props.value, () => {
  refresh()
})

updated to include immediate prevents the values from getting out of sync.

watch(() => props.value, () => {
  refresh()
}, { immediate: true })

PR #385

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