question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inspector modifies Changeset

See original GitHub issue

Not sure if this really is a bug or an unwanted side effect…

When I create a changeset from an ember-data model and open the ember-inspector tab, two properties are created in the changes attribute of the changeset. That means the changeset state (pristine) is changed just by inspecting the ember application… This continues to be true (even after reloading) until I *close( the console window (simply opening a different tab then the ember-inspector will not help)

I suspect this is because ember-data inspects the models and adds some private utility methods and that doesn’t play well with the changeset idea…

To Reproduce Create an changeset from an e-d model.

model() {
   return this.store.findRecord('model', id).then(model => new Changeset(model));
}

Add something like this to the template

<pre class="small">
    {{if this.model.isPristine "pristine" "dirty"}}
    {{json this.model.changes}}
</pre>

Expected behavior The rendered output should be:

pristine        []

But as soon as you open the ember-inspector it becomes;

dirty        [
  {
    "key": "_oldWillDestroy",
    "value": "function superWrapper() {\n      var orig = this._super;\n      this._super = superFunc;\n      var ret = func.apply(this, arguments);\n      this._super = orig;\n      return ret;\n    }"
  },
  {
    "key": "willDestroy",
    "value": "function superWrapper() {\n      var orig = this._super;\n      this._super = superFunc;\n      var ret = func.apply(this, arguments);\n      this._super = orig;\n      return ret;\n    }"
  }
]   

Environment ember-inspector: 4.1.0 ember: 3.16.8 ember-data: 3.16.6 ember-changeset: 3.4.0,

Chrome

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tzellmancommented, Jun 28, 2021

@snewcomer I am having this same issue, unfortunately. If you could kindly point me to the resolution (potentially linked in discord?), I would be greatly appreciative!

I am using v4.4.1 of the inspector, and am using the latest stable ember-changeset on an Ember 3.27 app. Thanks!

1reaction
wynnerdcommented, Sep 7, 2021

I’ve also got a very similar issue on 3.26.1, took a long time to debug it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a change set - AWS CloudFormation
To create a change set for a running stack, submit the changes that you want to make by providing a modified template, new...
Read more >
Use change sets to deploy custom metadata types and ...
Use change sets to deploy custom metadata types and records from a sandbox to another org. Typically you deploy the change set to...
Read more >
Salesforce Change Set Helper
Enhances the Salesforce change set. Adds last changed date and allows sorting, searching, validation and comparison with other orgs.
Read more >
Changesets in Content Change management - General Electric
Changeset in Content Change Management allows you to track changes made to database content before applying those changes to your production database.
Read more >
status | Liquibase Docs
It also lists the id, author, and file path name for each undeployed changeset. The status command does not modify the database.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found