-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix: Don't set dirty flag when shadow tiddler changes #8903
Conversation
@Rhys-T It appears that this is your first contribution to the project, welcome. With apologies for the bureaucracy, please could you prepare a separate PR to the 'tiddlywiki-com' branch with your signature for the Contributor License Agreement (see contributing.md). |
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Adds `shadow` and `normal` flags to each entry in `changedTiddlers`, indicating whether the corresponding version of the tiddler has changed. Makes the saver handler ignore any changes that aren't flagged `normal`. Fixes TiddlyWiki#8902.
Apologies, that message is appearing because I hadn't merged tiddlywiki-com into master since your CLA signature was merged. Should be fixed for your next commit. |
No, no, it's right, I haven't actually gotten to signing it yet. Give me a minute… |
Thanks @Rhys-T that's an interesting approach and I don't see any obvious flaws. Let's give it some testing. |
Submitted the CLA signature as #8904, |
Rhys-T has signed the Contributor License Agreement (see contributing.md) |
I did skim the code, and I am not sure about the initialisation. Especially if internal API is used with 3rd party plugin code. -- So IMO a bit more testing is needed. |
I tried to keep everything as compatible as I could. |
@@ -75,7 +75,7 @@ exports.startup = function() { | |||
$tw.wiki.unpackPluginTiddlers(); | |||
// Queue change events for the changed shadow tiddlers | |||
$tw.utils.each(Object.keys(changedShadowTiddlers),function(title) { | |||
$tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title]); | |||
$tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: I forgot to leave off the space after the comma to match the rest of the code. Is it worth another force-push, or should I leave it alone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A standard push should be fine.
I did some more tests with overwritten shadow tiddlers and it seems to work. @Jermolene -- It looks good to me. |
Thanks @Rhys-T |
Adds
shadow
andnormal
flags to each entry inchangedTiddlers
, indicating whether the corresponding version of the tiddler has changed. Makes the saver handler ignore any changes that aren't flaggednormal
.Fixes #8902.
I've tried this instead of changing
$:/config/SaverFilter
to exclude shadows, and it seems to be working properly for me. I haven't tested it extensively, however.