-
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
[BUG] StoryList is shared among clients as of 5.1.22 #4868
Comments
There is a setting in the ControlPanel for If it has to go away, we need a replacement, that also works in browser "private" mode! |
I think, this wouldn't be a problem, if the TW server would be a TiddlyWeb server. TiddlyWeb knows about "recipes" and "bags". IMO the problems which come up now with the whole multiuser-crux have all been thought through already. ...We have just forgotten them. More info see: http://tiddlyweb.com/ ... I'm not saying, that it should be a python implementation. I'm saying we should have a closer look about the "battle tested" workflow and configurations. |
A better link https://tank.peermore.com/tanks/tiddlyweb/HomePage |
@pmario I'm not familiar with TiddlyWeb - is it an implementation of the API that the tiddlyweb sync adaptor uses, similar to the one the NodeJS server provides? If so, does TiddlyWeb exclude system tiddlers in the results for the |
At the moment we only have |
At the moment we only have A tiddlyweb recipe usually has several lines of "bags" with filters. The bags are read from top to bottom. ... If tiddler names are duplicated, the "bottom one wins" Writing tiddlers uses the first bag, where the user has write access. .. IMO this could be different. It should start from the bottom. .. Because that's usually the bag the user has write access. filters can look like this.... But it could also be implemented as filter settings as done now. |
For me the existing server is still a development server. For real usage it would need to be implemented more like TiddlyWeb, with improvements learned. |
@pmario Ok, thanks for explaining!
By "existing server", you mean the server as implemented in NodeJS, right? I should clarify that I'm not exclusively talking about a multi-user situation - I'm the only user of my wiki, but this is still an issue for me if I have multiple tabs open to that wiki. |
I have run into the same issue even when just testing in different browsers. It is worth remembering that is due to a change in 5.1.22 by which system tiddlers are synchronized, and this is a change that unintentionally breaks backwards compatibility. Therefore I think we need to firstly prioritize addressing this bug by restoring the previous behaviour from 5.1.21, and separately work out a longer term and better solution. There have been two more reports of this issue on Discord in the last few weeks. What is worth noting is that using the syncFilter to prevent the StoryList and HistoryList from being synced are not sufficient to address the issues. Reverting to TW 5.1.21 was the only thing that resolved the problems. |
Yeah, it's worth mentioning that it's only present in 5.1.22 - my fix for the time being has been the following patch on top of two shadow tiddlers: diff --git a/tiddlers/_system/core/modules/syncer.js.js b/tiddlers/_system/core/modules/syncer.js.js
index 903bb0a4..0f7ac524 100644
--- a/tiddlers/_system/core/modules/syncer.js.js
+++ b/tiddlers/_system/core/modules/syncer.js.js
@@ -310,6 +310,7 @@ Syncer.prototype.syncFromServer = function() {
self.titlesToBeLoaded[title] = true;
});
$tw.utils.each(updates.deletions,function(title) {
+ if(self.wiki.isSystemTiddler(title)) return;
delete self.tiddlerInfo[title];
self.logger.log("Deleting tiddler missing from server:",title);
self.wiki.deleteTiddler(title);
@@ -355,6 +356,7 @@ Syncer.prototype.syncFromServer = function() {
}
// Delete any tiddlers that were previously reported but missing this time
$tw.utils.each(previousTitles,function(title) {
+ if(self.wiki.isSystemTiddler(title)) return;
delete self.tiddlerInfo[title];
self.logger.log("Deleting tiddler missing from server:",title);
self.wiki.deleteTiddler(title);
diff --git a/tiddlers/_system/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js.js b/tiddlers/_system/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js.js
index 5bc4e502..9bdcb6c5 100644
--- a/tiddlers/_system/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js.js
+++ b/tiddlers/_system/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js.js
@@ -159,7 +159,7 @@ TiddlyWebAdaptor.prototype.getSkinnyTiddlers = function(callback) {
$tw.utils.httpRequest({
url: this.host + "recipes/" + this.recipe + "/tiddlers.json",
data: {
- filter: "[all[tiddlers]] -[[$:/isEncrypted]] -[prefix[$:/temp/]] -[prefix[$:/status/]]"
+ filter: "[all[tiddlers]] -[[$:/isEncrypted]] -[prefix[$:/temp/]] -[prefix[$:/status/]] -[is[system]]"
},
callback: function(err,data) {
// Check for errors The tiddlywebadaptor patch is to make sure changes to system tiddlers like |
The crux of the issue seems to be that the story list (among other system tiddlers, as @saqimtiaz pointed out) is synced from the server to the client, which is what my patch above addresses. I think this raises a few questions:
|
All of them. If they are stored, it needs to be possible to load them. Otherwise you can disable storing them. .. IMO it's a per user setting.
That's not true. From my point of view, I want to have full control of the wiki state. ... The current import mechanism is kind of broken for me, since some tiddlers are physically removed from the import list. Even enabling them again doesn't import it. The same is true for me in a server based setting. ... The server needs to have an idea of different users or bags or recipes. .. That will solve the problem!
Yes. The $:/DefaultTiddlers have a setting like The same is true for |
I kind of understand what you're saying - but I'm not super familiar with bags and recipes, so I don't know how they'd work for my workflow. For example, I often have several different tabs/windows (which I'll just call "clients" from now on) open to my wiki:
As things currently stand, since system tiddlers are used so much to drive the UI within TiddlyWiki, if I'm syncing system tiddlers among these, clicking on a sidebar panel tab on one will change the others, opening a tiddler on one will change the story list on the others, etc. How would my workflow be supported using recipes/bags? Would I need to create a separate recipe per client as I've described them above? |
What you describe as a problem. ... Is a problem .. for you. ... I would love to be able to set up a server with a global address. Call someone on skype and tell them, they should open the address. Whatever I click on my wiki will be synced to the server and synced to the other persons browser. They can add some comments, that may be "live synced" back to my computer, if they have write access to a bag, that I can see. |
I think the problem here is 2 fold.
|
I'll try to create an overview of the TWeb structure. recipes ... are configurations that describe, who the server should build the content of a wiki.
A recipe as a json configuration, that could be part of rob.recipe.json
mario.recipe.json
So if the server has the info of the user name, it will show us 2 different wikis. The first one will be shown to user:rob and the bag-mario will not contain any of the system tiddlers in mario's bag. The second view is will be shown to user:mario without the system tiddlers from "bag-rob". ... AND if tiddlers with the same name exist in both bags rob's tiddlers will win. To change this user mario will need to be able to change the recipe to: mario.recipe.json
So now tiddlers show to mario in mario's bag will win. That's only part of the story, but it should make it clearer how it can work. |
I suggest we use this issue to discuss a solution for 1), i.e. the bug introduced in 5.1.22 and start another issue to discuss a better long term approach for syncing system tiddlers. The immediate priority should be to restore the user experience from 5.1.21 |
So
|
Makes sense to me - I've filed a new issue to focus on the system tiddlers syncing (#4882) |
IMHO, these settings should all be optional. I can appreciate how someone would want the StoryList and state tiddlers synced, especially when using it purely as a personal note taking tool. However, in my case, this is the biggest disruption. I'm setting the DefaultTiddlers with a filter that should make my newest published tiddler the startup tiddler for all other users. It should work, except for the StoryList is clobbering the filter as soon as it loads. I see the correct tiddler appear, then, since my StoryList is empty, it closes everything. |
@scarabdesign Do you still have |
Yes, that's the reason for the problem I sited. Is there a way to prevent it? I've tried deleting the tiddler, but it doesn't get deleted, unless I'm doing it wrong. |
@scarabdesign I imagine that if you delete the tiddler from within TiddlyWiki itself, your sync filter will prevent that deletion from going to the server - I think you'd need to shut down the server, delete the tiddler on disk, and then restart the server. |
Thanks @hoelzro @saqimtiaz @scarabdesign @pmario. I think it's reasonable to aim for a narrow fix for the moment – to continue to sync system tiddlers, but to explicitly exclude |
@Jermolene It seems to suffice for the most part - I did a little bit of tinkering and noticed that |
@hoelzro |
Thanks @hoelzro @scarabdesign I'm going to go ahead and commit the change to the SyncFilter |
@Jermolene I am not convinced we have the right fix here. We have tried to resolve one bug by breaking another feature, namely the ability to set the story list as the default tiddlers. I think what we need is to go back to how things were in 5.1.21 until we have a better solution. That is, the story list should be synced from the client to the server, but not from the server to the client. |
Ok, so it would be saved to the server but not synced out to the client during updates. What would that mean for new visitors to the site on the first visit? Would they get a new empty StoryList or would they get the StoryList that was saved to the server by the last user? If they get the saved one, they will see a bunch of tids they never requested and it may be quite confusing. However, if new users do not get the saved copy of the StoryList but an empty one, won't it overwrite the StoryList of the last user? If that's the case, is there a point to saving the StoryList at all? Spit balling here, but it seems more and more that each user needs to have a unique StoryList. Maybe authenticated users can save their lists to the server, if not, an option to save in local storage (if that's enabled). |
@scarabdesign So in a multi-user situation if you set your DefaultTiddlers to a specific set of tiddlers, that is what a new user will see when they load the wiki. The problem right now is that after this happens, $:/StoryList is synced from the server to the client and the tiddlers displayed change to match. Saving the Try running 5.1.21 to see the previous behaviour from before this bug with crept in due to the syncing of system tiddlers from the server to the client. As discussed earlier in this thread, the goal at this point should be to resolve this bug and return to previous stable behaviour, preferably without breaking other functionality, and then figure out a better solution for the multi-user use case separately. |
@Jermolene another issue that seems related to the excluding of $:/StoryList from the syncFilter is that permalink handling isn't working properly. When loading a permalink like: The $:/config/SyncFilter tiddler appears for a few seconds before being replaced by the DefaultTiddlers. Removing -[prefix[$:/StoryList]] from the syncFilter resolves the problem. |
So I've been looking into the sync mechanism and I will try to summarize my understanding of the problem:
|
Describe the bug
If you load a TiddlyWiki served via Node, the story list is shared among all clients.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Each client should have its own story list.
Desktop (please complete the following information):
Additional context
I think that I've seen other system tiddlers, such as the sidebar tab state, synced as well - that's weird to me since
$:/state/
tiddlers should be excluded via$:/config/SyncFilter
, so I'll need to try to reproduce this.Other reports
The text was updated successfully, but these errors were encountered: