Watfaq / PowerSession-rs

Rust implementation of PowerSession, with new features and enhancements
https://github.com/Watfaq/PowerSession-rs
MIT License
168 stars 7 forks source link

migrate old config file without api_server #178

Open Dominiquini opened 1 month ago

Dominiquini commented 1 month ago

Running on Windows PowerShell 7.4.2 inside Windows Terminal: If I run "PowerSession.exe auth" This error occurs ($env:RUST_BACKTRACE="full"):

thread 'main' panicked at src\commands\api\asciinema.rs:38:82:
called `Result::unwrap()` on an `Err` value: Error("missing field `api_server`", line: 1, column: 53)
stack backtrace:
   0:     0x7ff6a74e912a - <unknown>
   1:     0x7ff6a75045bb - <unknown>
   2:     0x7ff6a74e4a11 - <unknown>
   3:     0x7ff6a74e8eaa - <unknown>
   4:     0x7ff6a74eb64a - <unknown>
   5:     0x7ff6a74eb2b8 - <unknown>
   6:     0x7ff6a74ebcfe - <unknown>
   7:     0x7ff6a74ebbed - <unknown>
   8:     0x7ff6a74e9b19 - <unknown>
   9:     0x7ff6a74eb8f0 - <unknown>
  10:     0x7ff6a7519205 - <unknown>
  11:     0x7ff6a7519664 - <unknown>
  12:     0x7ff6a72898ce - <unknown>
  13:     0x7ff6a728a916 - <unknown>
  14:     0x7ff6a72ac046 - <unknown>
  15:     0x7ff6a72973f6 - <unknown>
  16:     0x7ff6a72a244c - <unknown>
  17:     0x7ff6a74de128 - <unknown>
  18:     0x7ff6a72adf9c - <unknown>
  19:     0x7ff6a750bbfc - <unknown>
  20:     0x7ffb741f7344 - BaseThreadInitThunk
  21:     0x7ffb75fe26b1 - RtlUserThreadStart

Thanks.

ibigbug commented 1 month ago

did you by any chance edit the config.json in the $APP_FOLDER/PowerSession/ ?

Dominiquini commented 1 month ago

config.json

I don't have this file! I downloaded the 'PowerSession.exe' for the releases page (https://github.com/Watfaq/PowerSession-rs/releases/tag/v0.1.11) and put it on a folder indexed by "$env:PATH"!

Thanks.

ibigbug commented 1 month ago

that's weird.

do you have anything here C:\Users\YOUR_USERNAME\AppData\Roaming\PowerSession

if not can you create a config.json with content

{"install_id":"d9870be7-bd89-4b53-844a-07b9746b8790","api_server":"https://asciinema.org"}
Dominiquini commented 1 month ago

that's weird.

do you have anything here C:\Users\YOUR_USERNAME\AppData\Roaming\PowerSession

if not can you create a config.json with content

{"install_id":"d9870be7-bd89-4b53-844a-07b9746b8790","api_server":"https://asciinema.org"}

I already have this file, but it contains: {"install_id":"285d7599-d8eb-4786-ba3d-622dd68f733b"}

I added the 'api_server' key and now it works! Maybe my config file was broken because I used the older version of PowerSession (https://github.com/Watfaq/PowerSession) and this new version don't fix the file! I think you can close this issue, but I thing that this bug will appear if someone was migrating from the older version!

Thanks

ibigbug commented 1 month ago

yeah good point. glad you solved it!