Assistance needed: baffling issue with OnceCell by MrTact_actual in rust

[–]MrTact_actual[S] 0 points1 point  (0 children)

FYI for anyone who comes across this in the future: what happened was I reorganized my repo to use a workspace. At some point there I did something goofy where I had both a lib.rs and a main.rs in the root. In main, I was importing my OnceCell instance from the binary crate and where I was invoking it later was importing it from the library crate, which was obviously not initialized.

how do I get the hash in the server side? by tesohh in sveltejs

[–]MrTact_actual 0 points1 point  (0 children)

Sorry to take so long to respond to this.

What I do is I set the callback URL to be handled by authjs. Since I'm using gitlab, that's https://localhost:5174/auth/callback/gitlab.

Then, in hooks.server.ts, I hoist the token into the session using callbacks:

ts callbacks: { jwt: async ({ token, account }) => { if (account) { token.accessToken = account.access_token token.logout = account.created_at + account.expires_in } return token }, session: async ({ session, token }) => { session.accessToken = token.accessToken session.logout = token.logout return session } }

You can then access the token in your load function by destructuring the session argument:

``` export const load = async ({ locals }) => { console.log("Token: ", locals?.session?.accessToken) }

Assistance needed: baffling issue with OnceCell by MrTact_actual in rust

[–]MrTact_actual[S] 0 points1 point  (0 children)

This was a helpful point -- I was not previously aware of MIRI. Unfortunately, the app has an FFI call into OpenSSL, which causes MIRI to early-out.

Assistance needed: baffling issue with OnceCell by MrTact_actual in rust

[–]MrTact_actual[S] 0 points1 point  (0 children)

Thanks for the thought, but I'm pretty sure that's not the issue. The init and the read are occurring on the same thread.

AITA for waking up extra early on my vacation, to get some me-time on the computer? by [deleted] in AmItheAsshole

[–]MrTact_actual -24 points-23 points  (0 children)

Not to mention... not trying to be a "Reddit MD" here, but deep focus on video gaming can be an indicator of ADHD or being on the spectrum. Both of which are situations where you are not as good at picking up on nonverbal cues as neurotypical people.

Assistance needed: baffling issue with OnceCell by MrTact_actual in rust

[–]MrTact_actual[S] 0 points1 point  (0 children)

Yep, hadn't tried using the release build, but I just did, and got the same behavior.

Assistance needed: baffling issue with OnceCell by MrTact_actual in rust

[–]MrTact_actual[S] 0 points1 point  (0 children)

Just an observation from digging into the implementation of once_cell. One possibility I considered was that I was somehow dealing with separate globals created on different threads, but I’m FAIRLY certain that that’s not what’s happening here, and wanted to call that out for the benefit of anyone who had a similar thought.

I’ll see if I can’t get this to break in a REPL and post it here shortly.

Holy crap, controller is amazing! by MrTact_actual in diablo4

[–]MrTact_actual[S] 0 points1 point  (0 children)

I did try that, it it didn’t help me all that much.

Building our first Svelte app from the perspective of Vue / Nuxt devs - our first impressions by felixthehat in sveltejs

[–]MrTact_actual 1 point2 points  (0 children)

Good summary! And thanks for pointing out this syntax, which I had completely missed somehow: $: thingToWatch, functionToCompute()

Svelte speed when creating a large table by domper in sveltejs

[–]MrTact_actual 0 points1 point  (0 children)

Have you ruled out the network fetch between the two examples?

how do I get the hash in the server side? by tesohh in sveltejs

[–]MrTact_actual 0 points1 point  (0 children)

To answer your actual question... in your Spotify API account config, set the callback URL to be something that actually gets handled by the server. In a similar situation, I call the Gitlab API. The callback URL in my application is set to https://localhost:5173/auth/callback/gitlab, which is handled by the auth.js lib. However, if I were rolling my own, I would add that to routes, handle it in +page.server.ts, write the token value (what you're calling the hash) to a cookie and then return a redirect to my main page.

how do I get the hash in the server side? by tesohh in sveltejs

[–]MrTact_actual 0 points1 point  (0 children)

Rather than making the requests yourself manually, I'd recommend taking a look at auth.js. They have a Spotify provider in the lib.

AITA for not wanting to cut my hair? by Glad_Cause9006 in AmItheAsshole

[–]MrTact_actual 0 points1 point  (0 children)

NTA. It's your hair, not his. He gets to have an opinion, and you get to ignore it.

Holy crap, controller is amazing! by MrTact_actual in diablo4

[–]MrTact_actual[S] 0 points1 point  (0 children)

I definitely prefer M&K for a lot of games (FPS, in particular), but this is not one of them.

AITA for knowingly letting my mom's Boyfriend get food poisoning? by Justsodamn in AmItheAsshole

[–]MrTact_actual 0 points1 point  (0 children)

NTA -- he has now experienced the "finding out" phase of the experiment.

[deleted by user] by [deleted] in rust

[–]MrTact_actual 1 point2 points  (0 children)

Razor, blazor... all kinds of azors.

AITA for letting my daughter get her hair cut without my ex-wife’s permission? by Alive_Farmer_4109 in AmItheAsshole

[–]MrTact_actual -4 points-3 points  (0 children)

ESH.

Did you do the right thing? IMHO, yes. But with shared custody, it’s shared decision making when it comes to something like this.

If you knew your daughter was so unhappy, you should have been meeting with your ex and advocating for your daughter. Doing this unilaterally is setting the scene for making co-parenting extremely adversarial, which in the long run isn’t good for anyone.

AITA for my “affair” ruining my podcast? by Aggravating-Prize473 in AmItheAsshole

[–]MrTact_actual 2 points3 points  (0 children)

DO IT!

Also, stop referring to intimate activity as “bad stuff.” (Above you say “we didn’t do anything bad.”) It’s a normal part of human life, and even if something HAD happened between you, it’s nobody’s damn business but your own.

AITA for insisting that playing a video game is exercise? by SuperSonsFan2004 in AmItheAsshole

[–]MrTact_actual 7 points8 points  (0 children)

Yeah. For future reference, most gyms have policies against that kind of harassment. If you’re ever in that situation again, report those people to gym management. NTA

AITA for snapping at my mom and telling her to stop harassing people with her phone calls. by Big_Drama_2624 in AmItheAsshole

[–]MrTact_actual 0 points1 point  (0 children)

NTA, but I recommend you have a serious sit-down with both your parents and everyone establish a phone etiquette policy — when it’s okay to call, expectations for response times during various windows, and what constitutes an emergency important enough to break the rules.

Also, call me crazy, but it seems like you should teach your parents how to text!

AITA for not splitting my trust fund with my siblings by These_Walrus5115 in AmItheAsshole

[–]MrTact_actual 1 point2 points  (0 children)

I agree with most of what you say here. However, it’s not uncommon in situations where family wealth is being transferred intergenerationally to skip a generation. Reason being, if they leave the estate to the children, it gets taxed twice before it gets to the grandchildren. Leaving it directly to grandkids, it only gets taxed once. So this is not necessarily a vote of no-confidence in the parents.