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

still up to date? #2

Closed
mohcow opened this issue Aug 8, 2024 · 14 comments
Closed

still up to date? #2

mohcow opened this issue Aug 8, 2024 · 14 comments

Comments

@mohcow
Copy link

mohcow commented Aug 8, 2024

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
Copy link
Author

mohcow commented Aug 8, 2024

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
Copy link
Owner

braye commented Aug 8, 2024

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
Copy link
Author

mohcow commented Aug 8, 2024

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
Copy link
Owner

braye commented Aug 8, 2024

Aw man, not "rip_ui.txt" 😭

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
Copy link
Author

mohcow commented Aug 8, 2024

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

@braye
Copy link
Owner

braye commented Aug 8, 2024

One last question - did Character level SavedVariables copy correctly?

@mohcow
Copy link
Author

mohcow commented Aug 8, 2024

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
Copy link
Owner

braye commented Aug 8, 2024

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
Copy link
Author

mohcow commented Aug 8, 2024

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

@braye
Copy link
Owner

braye commented Aug 8, 2024

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

@mohcow
Copy link
Author

mohcow commented Aug 8, 2024

"Enhance warnings about taking backups."

I take this personal!

@braye
Copy link
Owner

braye commented Aug 8, 2024

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

@mohcow
Copy link
Author

mohcow commented Aug 9, 2024

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.👍

@mohcow mohcow closed this as completed Aug 9, 2024
@braye
Copy link
Owner

braye commented Aug 9, 2024

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

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

2 participants