nchapman / pulsar

Mozilla Public License 2.0
1 stars 1 forks source link

Not being prompted to download a model #100

Open nchapman opened 2 months ago

nchapman commented 2 months ago

I just setup Pulsar on a new computer but wasn't prompted to download a model when I started the app.

image

nchapman commented 2 months ago

Likely related to this:

image

@ospfranco I know we've gone back and forth on the data directory. Let's get this figured out. I pulled some of the paths from Windows to help debug this:

{
  "data": "C:\\Users\\nchap\\AppData\\Roaming\\",
  "localData": "C:\\Users\\nchap\\AppData\\Local\\",
  "appConfig": "C:\\Users\\nchap\\AppData\\Roaming\\com.pulsar.dev\\",
  "appData": "C:\\Users\\nchap\\AppData\\Roaming\\com.pulsar.dev\\",
  "appLocalData": "C:\\Users\\nchap\\AppData\\Local\\com.pulsar.dev\\"
}

As you can see, $APPDATA is not the root of $APPLOCALDATA as is suggested in this commit.

We are using appLocalData here:

https://github.com/nchapman/pulsar/blob/f5d5fe8ea41e6e5b55b6e5fb6906844c523b25c3/src/entities/model/lib/getModelPath.ts#L8

We also use AppLocalData here, but I'm not sure this code works. I think it's using the enum value rather than the actual path.

https://github.com/nchapman/pulsar/blob/f5d5fe8ea41e6e5b55b6e5fb6906844c523b25c3/src/entities/model/api/downloadModel.ts#L12

I don't know where we're specifying the path for our WatermelonDB integration so I think we need to track that down and make sure it matches.

We need to standardize all these paths. I suggest we switch all of them to use appData instead of appLocalData. This will require us to download models again and reset databases, but I think this is the correct path going forward. We need to make sure that our WatermelonDB integration is also using appData.

ospfranco commented 2 months ago

Apparently, this is not as simple as it looks. It seems depending on the platform the home folder of the app changes quite a bit. On macOS is appData but on linux machines (and only discovered this because the app failed to launch for Yurii) it is a .config folder (which seems to be standard for some linux distros). As for watermelonDB, the path to save the database is not configurable, it just saves it on whatever folder the code is running on (appData, config, etc). For Windows we saw depending if you have some sort of cloud saves enabled that changes to the roaming folder, but if disables it should go to a "local" folder.

I also find the security model of Tauri confusing at best, but nothing we can do about it, in any case, it seems their regex is also not properly formed, because "**" paths do not work when there is a dot, e.g. ".config" so we also had to workaround this for Yurii.

I will try to move everything into a standard folder (appDir instead of appLocalData) but I don't think there is a one solution that fits all. I'm sure more errors will come with different distros/OS and libraries.

ospfranco commented 2 months ago

Also, on which branch are you running? I asked for feedback here:

https://github.com/nchapman/pulsar/issues/63

But didn't hear back

nchapman commented 2 months ago

@ospfranco sorry I missed that comment! I was testing on develop. Yeah I think we're going to see very different paths on each platform which is why our best bet is to just standardize on a single constant as much as possible 👍 . I do think we can revisit this and discuss the ideal paths to use once we get it working broadly.