Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactivity is lost when resources are created or received over socket and the resource was not fetched by a list request #12189

Open
richard-cox opened this issue Oct 9, 2024 · 0 comments · May be fixed by #12171

Comments

@richard-cox
Copy link
Member

Setup

  • Rancher version: dev of 2.10.0

Describe the bug

  • reactive was applied to objects that made it into the store via loadAll or loadPage
  • objects that are assigned to a component data object should also be reactive
  • however there are scenarios where changes to existing or new properties on these object did not trigger reactivity (computed, watch, etc), specifically when the resource has not been added to the store by loadAll/loadPage
    • A request to create a resource
    • A new resource is received over socket
    • A collection is fetched via labelSelect

To Reproduce

  1. Nav to any config maps detail page
  2. Update shell/detail/configmap.vue with
     data() {
       return { myObj: null };
     },
    
     async fetch() {
       await this.$store.dispatch('cluster/findAll', { type: 'configmap' });
    
       const myObj = await this.$store.dispatch('cluster/create', {
         type:     'configmap',
         metadata: {
           description: '1111',
           namespace:   'default',
           name:        'myobj',
         }
       });
    
       this.myObj = await myObj.save();
     },
    
     watch: {
       myObj: {
         handler(neu) {
           console.warn('rrc', 'watch', 'myObj', neu);
         },
         deep: true
       }
     },
    
    • on save this will create a new resource default/myobj
  3. In another browser do either of below
    • Edit as yaml and add immutable: false
    • Edit config and change the description
  4. With the change the console.warn should trigger. without the change it won't

Result

  • the console.warn does not trigger

Expected Result

  • the console.warn should trigger
@richard-cox richard-cox added this to the v2.10.0 milestone Oct 9, 2024
@richard-cox richard-cox self-assigned this Oct 9, 2024
@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Oct 9, 2024
@richard-cox richard-cox linked a pull request Oct 9, 2024 that will close this issue
7 tasks
@richard-cox richard-cox added QA/None and removed QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant