Partials that are not mine! (revisited)

I’ve always, like many, suffered the issue of partials getting created that are nothing to do with me, or any project I knowingly work on. But until now it’s never been a big deal, as it’s only a couple.

Now though, it’s got out of hand.

On every project I open 13 partials appear. They include…

  • Some pertaining to Formloom. (Don’t have it)
  • Some with the logo for rapidwebsites.net. (Never heard of them)
  • and some for Five Star Dentistry. (Never heard of them)

Did anyone ever work out a way to stop this happening? I delete them, but they soon appear back. It’s getting a bit ridiculous now.

What is at fault here; Radiweaver or Stacks? I need to know who to shout at ;-)

I don’t know exactly, but shouting at RW always leads to finger pointing to Stacks 🤨

1 Like

@TemplateRepo I had this issue too at one point (1 to 2 years ago). The issue was all about “externals”. This was a feature that was added to Stacks at one point. I finally got rid of the externals but essentially I had to do some RW project “surgery” by going inside the project file (i.e. right-click and opening the RW project).

If you go inside the project you’ll see a structure like this:

… now I’m going by memory but I think within the YHStacks Plugin folder I found a big size. And I found a lot of images within that folder (they were the externals that pass on from one project to another). Even if I got rid of the images there they would come back (if memory serves corrrectly). In the end I also needed to delete one of the contents.plist files you see in the screenshot. One of them was huge (like 50 Mb or larger). But I would only do this to a backup, eliminate, and then test out for a few days before relying on it.

Externals was supposed to be this new cool feature at one point. I don’t know of anybody who actually uses this feature in an ongoing way. But like a virus it seems you got from someone who shared a project with you that also had externals.

1 Like

To the best of my knowledge, here is why this happens… Because of the nature of the RW plugin system works, a plugin is allocated a specific memory space to run. This memory space is shared across all open projects. When you open a project, its partials, externals, templates and images they may contains are loaded into the project’s memory. Since the memory space that RW allocated for Stacks is shared across all projects, these items leak into other projects.

Is this RW’s fault or Stacks fault? It does not really matter. I do not expect it to be fixed by either developer. I do not expect this behavior to happen in Stacks Pro though.

2 Likes

I don’t know and I don’t care about whose fault it is. Like Joe, I hope this behavior will be eliminated in Stacks Pro app.

In my experience, if you have more than one project open at the same time, externals are infecting libraries of all open projects (I don’t recall having this problem with partials, though).

Removing externals from libraries of open projects is the first step. They will come back eventually if you won’t go to the next step: delete externals in Finder – which seems to be a permanent solution.

I go to
HardDisk>Users>MyName>Library>Group Containers>P97H7FTHWN.com.realmacsoftware.rapidweaver>Library>Application Support>Addons>Stacks>Externals

and delete contents of that last folder – or the entire Externals folder. This usually works for me – until I open a (third-party) project that includes some unwanted externals. Then the process needs to be repeated.

Disclaimer: I am still using Mojave OS. In newer system installations, you may not find Externals folder at the same location. If that’s the case, Control-click on any external in your RW library and select the ‘Show in Finder’ option.

1 Like

Seems like there’s a lot of confusion around this issue, and why it exists. Let’s dive into the details to determine the actual cause.

The problem

Stacks externals are being copied between projects.

Why is this happening

@joeworkman is on the right track with explanation of memory space being shared between all open projects. However, RapidWeaver doesn’t allocate this, Stacks is responsible for allocating and managing its own memory.

Further to this, RapidWeaver doesn’t have any control over the content that is saved from a plugin. RapidWeaver requests raw data to be saved, and persists it to a file on your hard drive. It’s also responsible for reading the raw data and passing it to the plugin during load. RapidWeaver itself doesn’t have any knowledge of the contents of this data.

We don’t have access to the Stacks source code so the below is a best guess based on the problem you’re seeing.

To the best of our knowledge, Stacks is using something called a singleton class to store project data. The singleton design pattern restricts the instantiation of a class to a single object. This means that only one instance of the class can be created throughout the entire program and is shared between all open projects.

It’s absolutely fine to do this, however the developer should exercise extreme caution when doing so to prevent unexpected or hard to fix bugs.

Say we have a singleton class called FileStore which is responsible for storing a list of paths to files the project uses. After opening gallery.rwc, the FileStore could look like this.

[
	~/Desktop/photos/image1.jpeg,
	~/Desktop/photos/image2.jpeg
]

Lets open another project, blog.rwc. This project also contains files which need to be added to the FileStore. Here’s how the FileStore could look after opening the blog project.

[
	~/Desktop/photos/image1.jpeg,
	~/Desktop/photos/image2.jpeg,
	~/Desktop/dogs/doberman.jpeg,
	~/Desktop/dogs/labrador.jpeg
]

You can see how the FileStore has become polluted with content from both open projects. When saving the gallery.rwc project file, there’s no way to identify which files in FileStore are used in which project.

Fortunately, the way to solve this is quite trivial, the FileStore should index files based on the document.

{
	“gallery.rwc”: [	
		~/Desktop/photos/image1.jpeg,
		~/Desktop/photos/image2.jpeg
	],
	“blog.rwc”: [
		~/Desktop/dogs/doberman.jpeg,
		~/Desktop/dogs/labrador.jpeg
	]
}

Now when a project is saved, it’s simple to find which files are being used by which project.

Summary

We believe Stacks is using this method to index Externals. We also believe Stacks isn’t keeping track of the Externals used within a project. So when a project is saved, all Externals are copied into the project file just in case they’re being used.

Unfortunately there’s absolutely nothing we can do in RapidWeaver to address this issue. It’s entirely the responsibility of the plugin to manage the data it stores in the project file.

I really wish we could fix this issue, but it’s out of our control. I’m afraid it’s very likely this will also be a problem in Stacks Pro until it’s fixed.

3 Likes

I gave up. This bugs me now for years. It’s not only the partials, also random images get added to the project folder. I have profile pics, dirt diggers, houses, logos …

There was a lengthy explanation (as @mitchellm pointed out, related to Externals) from Isiah on this, he tried to do some fixes but this problem never got solved.