Skip to content
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(main): Rename failed, attempted creation successful. #2

Open
FormalSnake opened this issue Nov 1, 2023 · 11 comments
Open

bug(main): Rename failed, attempted creation successful. #2

FormalSnake opened this issue Nov 1, 2023 · 11 comments

Comments

@FormalSnake
Copy link

So there is a path system, but it uses the C drive, which is not doable on mac. This could be done by getting the system document folder, but idk in rust.

lazy_static! {
    static ref PATH: Mutex<String> = Mutex::new("C:/Users/User/Documents/GitHub/text-editor/Folder".to_string());
}
@FormalSnake
Copy link
Author

@face-hh
Copy link
Owner

face-hh commented Nov 1, 2023

That's a placeholder, you can assume the string is empty. It will fail to read the document regardless of its initial value.

You did however remind me that I've forgot some few if statements while writing the latest commit; I've now added a check to prevent the reset of the config.json file:

let exists = &dir.join("config.json").exists();

About MacOS support, I'm not sure if the code will compile there since the very first line of code is:

#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

I'd be happy to adjust the code to work on Mac if someone will open an issue with the error stack from MacOS

@face-hh face-hh closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
@FormalSnake
Copy link
Author

I will do that in a few hours, I am going to watch FNAF lol 🤣

@creeperita09
Copy link

ima help you and send the stack trace in like 10 mins

@FormalSnake
Copy link
Author

So, using bun run dev it worked!
But there seems to be an issue with saving files.

Created config folder in AppData
(MINOR) Child with id not found: 0
(MINOR) Child with id not found: 2321c09016c1b6e
Renamed "Untitled 2321c09016c1b6e.md" to "H.md"
Renamed "H.md" to "He.md"
Renamed "He.md" to "Hel.md"
Renamed "Hel.md" to "Hell.md"
Renamed "Hell.md" to "Hello.md"
(MINOR) Child with id not found: 4e0e21e66fe6e04
Renamed "Untitled 4e0e21e66fe6e04.md" to "H.md"
Renamed "H.md" to "He.md"
Renamed "He.md" to "Hel.md"
Renamed "Hel.md" to "Hell.md"
Renamed "Hell.md" to "Hello.md"
Renamed "Hello.md" to "Hello .md"
Renamed "Hello .md" to "Hello t.md"
Renamed "Hello t.md" to "Hello th.md"
Renamed "Hello th.md" to "Hello the.md"
Renamed "Hello the.md" to "Hello ther.md"
Renamed "Hello ther.md" to "Hello there.md"
Renamed "Hello there.md" to "Hello there!.md"
Rename failed, attempted creation successful.
Renamed "H.md" to "Hi.md"
Couldn't find child with path: H.md
Renamed "Hi.md" to "Hi!.md"
Couldn't find child with path: Hi.md

@face-hh
Copy link
Owner

face-hh commented Nov 2, 2023

Could you try replicating the issue, but only using alphabetical characters in the title? Seems like the error occurred when you inserted "!".

@FormalSnake
Copy link
Author

It works, but the issue is that the first tab doesn't work, it doesn't save.

@FormalSnake
Copy link
Author

Renamed ".md" to "f.md"
Couldn't find child with path: .md
Renamed "f.md" to "fi.md"
Couldn't find child with path: f.md
Renamed "fi.md" to "fir.md"
Couldn't find child with path: fi.md
Renamed "fir.md" to "firs.md"
Couldn't find child with path: fir.md
Renamed "firs.md" to "first.md"
Couldn't find child with path: firs.md
Renamed "first.md" to "firstt.md"
Couldn't find child with path: first.md
Renamed "firstt.md" to "firstta.md"
Couldn't find child with path: firstt.md
Renamed "firstta.md" to "firsttab.md"
Couldn't find child with path: firstta.md
Renamed "firsttab.md" to "First tab.md"
Couldn't find child with path: firsttab.md

@face-hh
Copy link
Owner

face-hh commented Nov 2, 2023

It works, but the issue is that the first tab doesn't work, it doesn't save.

That's since it failed once and lost the path forever. To temporarily fix this, you can delete your config.json.

If you take a look at %APPDATA%/Fextify/Data/data/ (may be different on MacOS) you'll see that it's currently being spammed by files.

If you wish, once you empty your config.json, you can follow some debugging steps I've previously provided:

Could you try replicating the issue, but only using alphabetical characters in the title? Seems like the error occurred when you inserted "!".

@FormalSnake
Copy link
Author

What is that on mac? It is not in Application Support which should be the mac version of %appdata%

@face-hh
Copy link
Owner

face-hh commented Nov 3, 2023

What is that on mac? It is not in Application Support which should be the mac version of %appdata%

I'm unsure, but you can modify src-tauri/src/main.rs at line 46 to be:

println!("{:?}", dir);

Then you can recompile the program on dev (npm run tauri dev), and check the terminal for the path to be printed.

I will reopen this issue until the issue gets resolved.

@face-hh face-hh reopened this Nov 3, 2023
@face-hh face-hh changed the title MacOS support! bug(main): Rename failed, attempted creation successful. Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants