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

The in-memory search indexer is observing mutation of the composition property. #5549

Closed
7 tasks
akhenry opened this issue Jul 22, 2022 · 3 comments · Fixed by #5609 or #5610
Closed
7 tasks

The in-memory search indexer is observing mutation of the composition property. #5549

akhenry opened this issue Jul 22, 2022 · 3 comments · Fixed by #5609 or #5610

Comments

@akhenry
Copy link
Contributor

akhenry commented Jul 22, 2022

this.indexedCompositions[keyString] = this.openmct.objects.observe(

This is an unreliable method of detecting composition changes as not all objects will use the composition property to define their composition.

Instead, the Composition API should be used. It provides observers for composition changes that are agnostic of the underlying data structure.

Environment

  • Open MCT Version:
  • Deployment Type:
  • OS:
  • Browser:

Impact Check List

  • Data loss or misrepresented data?
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug with no functional impact?
  • Does this block the execution of e2e tests?
  • Does this have an impact on Performance?

Additional Information

@scottbell
Copy link
Contributor

To test:

  1. Add a folder object
  2. Add a clock object
  3. Ensure you can search for folder and clock
  4. Refresh page
  5. Ensure you can search for folder and clock

@scottbell
Copy link
Contributor

On our test server, we're getting an error:

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'MessagePort': function(e,t){let o=e,a=t;return o<a&&(o=t,a=e),o-a<.5} could not be cloned.
    at InMemorySearchProvider.index (webpack-internal:///5244:747:34)
    at InMemorySearchProvider.onCompositionAdded (webpack-internal:///5244:692:18)
    at eval (webpack-internal:///6243:324:19)
    at Array.forEach (<anonymous>)
    at CompositionCollection.emit (webpack-internal:///6243:320:31)
    at CompositionCollection.add (webpack-internal:///6243:206:18)
    at eval (webpack-internal:///6243:226:48)
    at Array.forEach (<anonymous>)
    at CompositionCollection.eval (webpack-internal:///6243:226:30)
    at async InMemorySearchProvider.index (webpack-internal:///5244:758:30)

This is probably because the object has dangling functions on it. We should turn this into a domain object that can be serialized properly by structuredClone so the post to the InMemoryIndexer will work.

@scottbell scottbell linked a pull request Aug 4, 2022 that will close this issue
5 tasks
@scottbell scottbell linked a pull request Aug 8, 2022 that will close this issue
15 tasks
@ozyx
Copy link
Contributor

ozyx commented Aug 22, 2022

Verified Testathon 8/22/22:

Found an additional issue while testing, logged here: #5690

@unlikelyzero unlikelyzero added this to the Target:2.0.8 milestone Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants