settings-profiles-obsidian-plugin
settings-profiles-obsidian-plugin copied to clipboard
[Bug]: Profile sync of changed settings and UI updates are not working
Describe the bug
Profile sync of changed settings and UI updates are not working. My current workaround is to save settings to profile and then unselect/reselect the profile in another vault.
How to Reproduce
- Install the plugin and create a new profile with default settings.
- Click save settings to profile and select the profile.
- Open a different vault and install the plugin and select the profile.
- Make changes in the original vault. Look for updates in the second vault.
Expected behavior
Changed settings should automatically sync with the selected profile. When changes are detected, the UI should automatically update with the new settings.
OS of your device
macOS
Obsidian Version
v1.7.7
Plugin Version
0.5.9
Additional context
No response
Thanks for your bug report I know about this issue. I try to fix it as soon as possible. Have you checked it is just the UI or are the changes applied?
Both are failing. Thanks for looking into it.
I'm having similar issues since upgrading from 1.5 to 1.8.9. It seems the plugin broke as trying to force reloading of the profile does nothing. (e.g., also the breadcrumbs extension broke)
(e.g., also the breadcrumbs extension broke)
What do you mean by that? What exactly broke or is not working anymore?
It would not sync profiles.
e.g., if I have X and Y both with the plugin installed and I modify X such as add a plugin, save the profile(I had just one), then go to Y it does not automatically load the profile(sync it, hence add the new plugin). If I manually load the profile by changing the profile to itself it wouldn't work.
I ended up creating a second profile(saving the main one to backup) and then switching between them and such and I was able to get the reload to work. It all seemed to work fine before the update best I could tell but I wasn't using it much right before then since I had everything already working. I have no idea if the sync was working but best I could tell it didn't but I already had everything setup before I created other vaults to push to.
What I have is about 10 vaults and I'm trying to use one profile for all of them. This could be problematic, I imagine, if there is specific vault settings per plugin that are suppose to be different but I don't think I need to worry about that in my case as I want the same profile to persist. I could symlink them all but I didn't want to mess with that and it seems like this plugin is suppose to do all that better. I have auto-sync on(all settings are default except path) but it simply wasn't syncing a new plugin I added no matter what I tried.
It's possible I screwed something up. I'm pretty sure I saved the profile and then tried to reload it and such and nothing was working(my other vaults simply would not get the plugin I installed in the main vault). Only once I made a backup did it work pretty much immediately(I switched to the backup and then to the main). Only think I can think of is that I might have been double clicking on the "deselect profile" and that seems to bypass the dialog to actually reload(since I caught myself doing that recently). The dialog doesn't show long enough to see it on a double click. I just figured it was something to do with updating since that was the major change and several plugins broke in the process.
Just to be clear:
- If I got to the main vault. Install a plugin then exit.
- Load a secondary vault then it does not have the plugin I installed in main. (hence what I would say it is not "auto-syncing")
- If I go to the main vault again, save the profile then exist.
- Load the secondary vault, it does not have the plugin.
- So I have to deselect the main profile(click the man icon), ignore saving, then click it again and reload. Now the plugin shows up. [Note that right after the update, when I did the following, I couldn't get the plugin to show up at all until I made the backup and switched to it then back to the main, but as I said, I might have not properly loaded the plugin or maybe it was due to some issues with the other plugins that were failing]
This does not seem to be how things should work. Essentially it is "manual mode".
In fact, maybe a good option to have would be to symlink all the plugin dirs in the vaults to the profile plugins. this way they are always updated. What I'm trying to avoid is having to install the same plugins in 10 different vaults as I want the same plugins available for all the vaults. I guess I could
all settings are default except path
Is path the same for all of your vaults? And are all your vaults on same device?
Also important to know what OS are you using?
- If I got to the main vault. Install a plugin then exit.
- Load a secondary vault then it does not have the plugin I installed in main. (hence what I would say it is not "auto-syncing")
- If I go to the main vault again, save the profile then exist.
- Load the secondary vault, it does not have the plugin.
- So I have to deselect the main profile(click the man icon), ignore saving, then click it again and reload. Now the plugin shows up. [Note that right after the update, when I did the following, I couldn't get the plugin to show up at all until I made the backup and switched to it then back to the main, but as I said, I might have not properly loaded the plugin or maybe it was due to some issues with the other plugins that were failing]
You are right it should be 1 and than 2 but the plugin should be installed for auto sync I have some trouble with properly detecting the changes.
In fact, maybe a good option to have would be to symlink all the plugin dirs in the vaults to the profile plugins. this way they are always updated. What I'm trying to avoid is having to install the same plugins in 10 different vaults as I want the same plugins available for all the vaults. I guess I could
This sound in fact like a great feature but I think this could have some difficulties
The parent is the same. I have all my vaults the same a subdir and they are all on windows.
I installed the plugin on all the vaults so I could get them to use the profiles(else there is no way to get it to work in the first place). All the settings were default except for the basic stuff that must be set. Auto sync was set and all that.
I don't actually mind having to manually sync because I rarely add plugins now and it's not that big a deal if I miss something for a while.
It shouldn't be that hard to at least determine if something is out of sync with the plugins by simply checking the number of sub-dirs in plugins for the profile and the vault. If the vault has less plugins you could pop up a dialog box on vault load and say there are fewer plugins in the vault than the profile and even list them and ask if one wants to sync. You could also reverse it(two way sync). This will at least keep the installed plugins in sync(which is generally the main thing).
This just keeps the plugins consistently installed, it doesn't mess with them after they are installed(so any changes in the data.json won't be a problem). It would be a better option to keep things consistent because then one doesn't have to worry about data.json inconsistencies or overwriting on profile loads.
Again, the main issue I'm trying to avoid is having to manually install plugins for all vaults. I could script it pretty easily but I'd have to still run it or automate it.
Probably you could also then just check if the data.json files are different and then ask the user if they want to sync them(forward or backward) or to ignore that plugins data.json(or possibly other generated files).
I am checking there are changes in the config of the vault here https://github.com/4Source/settings-profiles-obsidian-plugin/blob/16aeecc1ffef1a01580cdfb45c67a31576348881/src/main.ts#L30
A problem I have is I tired to make it compatible for multiple devices and this brings some difficulties into this.
I planning to do a major refactoring that will hopefully solve all the problems we currently have with this plugin.
Ok, no big deal. For the most part it solved my initial problem of installing most of the plugins(around 70) across several 10 or so vaults. That got the bulk of the problems. I haven't been installing many plugins lately so I haven't had to worry about the issue.
Once I get finished trying to mess with some other extensions I might play around with this one and see if I can add anything.
Ok, no big deal. For the most part it solved my initial problem of installing most of the plugins(around 70) across several 10 or so vaults.
Great this was the initial Idea of this plugin
If you find any other problems or have additional information I am interested in all the information I can get.
FYI: I am currently analyzing all the problems and planning the changes. If I finish this I will send an announcement. If you have any thoughts or different ideas I would like to hear them.
I'll probably wait for you to get finished then look at it. I'm new to Obsidian(well no but I just decided to actually learn it correctly) and writing extensions for it. I'm trying to fixed two extensions right now that are not working correctly and I've wasted a lot of time just trying to get them to work with vs code ;/ turns out obsidian does some strange stuff like load main.js with eval, requires main.js to be in root(this causes path issues with extern source maps and using symlinks). So if I ever get that stuff working to use vscode then I'll come back here start messing with this extension.
I develop all my plugins inside a special plugin development vault so I don't have to be scared if I mess with the vault and most plugins I have looked into the code are configured that the main.js is placed into the plugin folder.
File structure
- ObsidianPluginVault/
- .obsidian/
- plugins/
- settings-profiles/
- src/
- main.ts
- ...
- main.js
- manifest.json
- data.json
- package.json
- style.css
- ...
- src/
- vare/
- main.js
- manifest.json
- ...
- settings-profiles/
- snippets/
- app.json
- ...
- plugins/
- Note files
- .obsidian/
Hint: I could recommend to join the Obsidain Discord server if you have questions there is a plugin developer channel
Yea, I created a Test vault. The problem is debugging the source code in a reasonable way. I did similar to what you have but when I try to debug I always end up with source map issues. I eventually got it to almost work then something happened and it broke again.
Part of the issue is that I'm using symlinks so the extension was cloned in it's own repo dir. I symlink it to the .obsidian plugins directory so obsidian will load it. The issue is getting the breakpoints working which requires the right settings in the various config files. The idea is to be able to do all the debugging from vscode rather than having to code and debug from the chrome debugger. The best I got was getting the BP's to work in vscode but I couldn't get it to open/use the project's main.ts file directly which was my goal. It would always load a read only copy which I guess it was pulling remotely. Once I got that working I messed with something the next day and it all fell apart and I couldn't put Humpty Dumpty back together again ;)
I guess I could look for that discord and ask some relevant questions ;)
Part of the issue is that I'm using symlinks so the extension was cloned in it's own repo dir. I symlink it to the .obsidian plugins directory so obsidian will load it. The issue is getting the breakpoints working which requires the right settings in the various config files. The idea is to be able to do all the debugging from vscode rather than having to code and debug from the chrome debugger. The best I got was getting the BP's to work in vscode but I couldn't get it to open/use the project's main.ts file directly which was my goal. It would always load a read only copy which I guess it was pulling remotely. Once I got that working I messed with something the next day and it all fell apart and I couldn't put Humpty Dumpty back together again ;)
Can't give you any tipps on that as I started the only thing I could found is that you can't really do it. I'am doing it the hard way with console log
Lol, ok. I'll let you know if I ever get it to work properly. I mean, you can effectively get most of it if you wanted. I'm not sure if it is any better or not but I like to at least have the option to use which ever environment I want ;)
Lol, ok. I'll let you know if I ever get it to work properly. I mean, you can effectively get most of it if you wanted. I'm not sure if it is any better or not but I like to at least have the option to use which ever environment I want ;)
This would be great the debugging with console.log is really exhausting and not really good