Replies: 6 comments 3 replies
-
I think that's a great idea and it is very well executed. -- But -- I am not sure, if it is easy to make it "automagically"
At startup we would need to check all tiddlers with a Assuming the number of overwritten shadows is small, that should not be a startup performance problem. Just some ideas. -- Edge cases are not dealt with at that moment. |
Beta Was this translation helpful? Give feedback.
-
IMO related to: Strategy for documenting backwards compatibity breaks #9142 |
Beta Was this translation helpful? Give feedback.
-
Maybe that's exactly what I'll do here so FWIW:
Not quite; Yes, if an overwrite is created by a user it is a tiddler and there's also a shadow with the same name. But an overwrite can have been packaged into a plugin, in which case it is now a real shadow tiddler (...and the wiki has two real shadows tiddlers with the same name but different content! BTW, TW has some priority mechanism here, right? E.g "last call wins"?) BUT, to at least "do the OP" for the core it would be simple to identify such non-core plugin shadows copies because they're prefixed
In my Overwrite plugin, I have an exceptions list that don't cause alerts, which the user can also modify.
Only if the open the tiddler manually but they might overwrite it remotely. My conclusion, as stated in the OP, is that the Import mechanism is the perfect place - and time - for this mechanism. But I'm not sure if there's a problem with this for when the full TW is dragged on to the upgrade page. |
Beta Was this translation helpful? Give feedback.
-
Questions: The
As indicated previously, I want to add some actions to happen when this button is clicked; What would be the best way to do this? Perhaps to add a As noted, I think this is the optimal place and time for storing the sha256 values of the existing plugin shadow overwrites, i.e just before the new updated plugin replaces them. Are there arguments against this? The only argument I can think of is if there are other ways to import, bypassing the above mentioned button in the It would be ironic if this solution to "Making overwrites unproblematic" itself required an overwritten import mechanism. So, @Jermolene , could the import button somehow be modified in the core to allow for this action to be added to the button? For anyone wanting to test outlined approach in the OP, here's how to get the text from the actual shadow tiddler (i.e not its overwrite).
Again, its |
Beta Was this translation helpful? Give feedback.
-
Without core changes I suspect your best bet is to make a view template segment that is only displayed for the |
Beta Was this translation helpful? Give feedback.
-
Turns out I alerted about this already in #5518 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
"The best thing with TW is that you can modify it to your needs!"
...but overwriting shadow tiddlers can cause problems because updates of the shadow tiddlers don't take effect and may have unintended consequences.
Clearly a conflict!
Even abiding users can naïvely and unknowingly be subjects to this problem; In spite of never overwriting anything themselves, they may have installed plugins (from others) with shadow tids that are really overwrites of core tiddlers!
My Overwrite plugin addresses this problem to some extent. Basically, for every overwrite it lets the user create a hash code (
sha256[]
) for the underlying shadow. Then if the shadow is updated, its hash is compared to the stored hash and an alert is sent if they don't match. Since merely a hash number is stored, it is a pretty efficient approach, I think.The alert prompts the user to compare the overwrite with the new shadow, simply using the editview diff comparison - so the user can either dismiss the alert, modify the overwrite or simply delete it. An alternative could be to, in the plugin list, mark out plugins that need updating to match the new core version (and subplugins to match their main plugin).
Proposal
In the name of maximum TW modifiability, I propose that TW natively features alerts for updated shadows with overwrites. I think it the outlined approach could work. A problem is this:
What should trigger the storing of the hash?
At first glance it may seem that saving an overwrite, i.e clicking the overwrite "save tiddler"-button, should trigger the storing. But not every overwrite involves such manual saving. In the Overwrite plugin I made a central "shapshot" button to create+store the hash for all overwritten shadows; The user is to click this at some time, ideally just before updating his wiki. OK, but not optimal. A possibly better idea could be to have the Import mechanism button first triggers the storing of the hashes. (Would this work when upgrading the core via the tw/upgrade site?)
Note: It is neat that the stored hash potentially remains unchanged for years and years, through core updates, for as long as the concerned single shadow tiddler is not modified.
Whaddyasay? Doable? Already for 5.4.0 ?
Beta Was this translation helpful? Give feedback.
All reactions