minsk-hackerspace / hackerspace.by

Website of Minsk Hackerspace (Ruby on Rails)
https://hackerspace.by/
11 stars 20 forks source link

Fix for user welcome email empty password #625

Closed yahor closed 3 months ago

yahor commented 3 months ago

https://github.com/minsk-hackerspace/hackerspace.by/issues/619

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 57.78%. Comparing base (9983ccf) to head (4c4f69a).

Files Patch % Lines
app/controllers/admin/users_controller.rb 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #625 +/- ## ======================================= Coverage 57.78% 57.78% ======================================= Files 66 66 Lines 1445 1445 ======================================= Hits 835 835 Misses 610 610 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

abitrolly commented 3 months ago

Is the cause of the empty password that welcome email is sent before the user is actually created and saved?

yahor commented 3 months ago

yes, it was issue of password value in mailer object invoked by background job.

jekhor commented 3 months ago

О, касяк серыялізацыі аб'ектаў пры змяшчэнні ў чаргу для мэйлера. Натыкаўся ўжо...

abitrolly commented 3 months ago

But why the mailer doesn't use the real user object to get the password?

jekhor commented 3 months ago

But why the mailer doesn't use the real user object to get the password?

Because it runs after an object destruction.

abitrolly commented 3 months ago

Why the object is destructed when it is still used?

jekhor commented 3 months ago

Due to asynchronous nature of mailing queue

аў, 12 сак 2024, 23:14 карыстальнік Anatoli Babenia < @.***> напісаў:

Why the object is destructed when it is still used?

— Reply to this email directly, view it on GitHub https://github.com/minsk-hackerspace/hackerspace.by/pull/625#issuecomment-1992598202, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA4VW6LJRRMVXOMQIZVGY3YX5V4JAVCNFSM6AAAAABEOZKEW6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSGU4TQMRQGI . You are receiving this because you modified the open/close state.Message ID: @.***>

abitrolly commented 3 months ago

Bad framework. Let's use PHP. )