braye / wow-profile-copy

TUI application that copies WoW configuration data around
GNU General Public License v3.0
5 stars 2 forks source link

still up to date? #2

Closed mohcow closed 1 month ago

mohcow commented 1 month ago

Is this still up to date? I used it and it nuked my whole SavedVariables. Everything is reset even characters i didn't use the tool on. What's even the point of copying SavedVariables on the same server and account?

mohcow commented 1 month ago

Just did it with less files in SavedVariables and yes your tool just nukes everything in SavedVariables. WeakAuras.lua from 11Mb to 0KB. Lovely stuff.

braye commented 1 month ago

I don't play WoW currently and haven't had the need for this tool for a while. I wouldn't think they've changed their folder structure though, so it probably should still work.

I'm sorry that your SavedVariables got wiped out - not really sure how that happened. I swear I've copied between characters on the same account and realm before without issue. The code works that way because this was originally written to copy over my addons and settings from live to PTR realms.

All of that said, the warning about making backups is present for a reason.

If you could provide some more information (account, realm, and character structure that you were trying to copy to/from) I might be able to reproduce the issue and write a fix.

mohcow commented 1 month ago

All good, my mistake for not making a backup.

See the attachment. This is the output i got. As you can see its same server and account but it still copied */ACCOUNT/xxxxxx#1/SavedVariables which makes no sense to me. no? And what does it copy anyway?

braye commented 1 month ago

Aw man, not "rip_ui.txt" :sob:

Basically some addons (I think Dominos was one, can't remember exactly) store data in both account-level variables and character-level variables and won't copy settings properly if both of those files aren't in place on the new account/character.

You're right that there's no reason to copy the account stuff if not switching accounts but I'm almost certain that I have tested this exact use case when starting an alt and it worked just fine.

Just as a sanity check, what version of the tool are you using? I didn't see it in the output.

mohcow commented 1 month ago

Doesn't say at startup, but i'm 100% sure i downloaded the latest release.

braye commented 1 month ago

One last question - did Character level SavedVariables copy correctly?

mohcow commented 1 month ago

Can't say for certain because i started the game and logged into the new character right after so any addon *.lua file missing was created at startup. But AddOns.txt and macros-cache.txt are matching, so that looks good.

https://imgur.com/n2FqVot

left is source | right is target

braye commented 1 month ago

Okay, I was able to reproduce this on my machine. I could have sworn I tested this, sorry.

Basically what's going on is that when copying files around, I'm being "clever" and copying bytes between file descriptors instead of reading the file into memory and then writing it into the destination. The problem is that os.Create() truncates the file when creating the fd, which is something we want when copying to a different destination, but causes problems when the source and destination are the same.

No idea why I thought that calling os.Create() on a file with an open fd from the same process on it would throw an error. Going to push a fix for this shortly.

If it makes you feel better, in college I lost an IRC bot that I really liked in basically this same way. You think I would have learned!

mohcow commented 1 month ago

Good stuff. Will take another look after i rebuild my UI (and making a backup)🥳

braye commented 1 month ago

Alright I just cut 0.3.0-rc1 as a pre-release. Should address this problem.

mohcow commented 1 month ago

"Enhance warnings about taking backups."

I take this personal!

braye commented 1 month ago

To be fair, it was easy to miss if you were just rushing through things! Haha.

mohcow commented 1 month ago

OK, I tried it and it seems to work on my end as well, at least nothing broke :) Therefore I'll close the issue. Thanks for fixing it that quick. The tool will be useful to a lot of people, so good on you for maintaining it.👍

braye commented 1 month ago

You're welcome! Thanks for reporting this - I'm sure you saved someone else's WeakAuras. 😅