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

Referrals graph reporting referral before my account existed #1044

Closed
SatsAllDay opened this issue Apr 8, 2024 · 7 comments
Closed

Referrals graph reporting referral before my account existed #1044

SatsAllDay opened this issue Apr 8, 2024 · 7 comments
Labels

Comments

@SatsAllDay
Copy link
Contributor

Description
The referrals page indicates that I have a referral from year 2021, before my account even existed (created in 2023).

Steps to Reproduce

  1. Navigate to https://stacker.news/referrals/forever
  2. Observer referrals

Expected behavior
Only expect to see actual referrals?

Screenshots
image

Logs
N/A

Environment:
N/A

Additional context
I verified this data is included in the API response, so I don't think it's a UI bug.

@SatsAllDay SatsAllDay added the bug label Apr 8, 2024
@huumn
Copy link
Member

huumn commented Apr 8, 2024

This is a side effect of ffa86ab which allows (knowingly) referrals to get attributed on login/auth linking.

We plan to change referrals to be even more dynamic than this. Meaning, your active referrer will be the the last referral link you clicked regardless of whether you had a previous referrer or not.

This was a weird eureka we had over the weekend observing the effect of ffa86ab. It'll incentivize both external *and internal link sharing (ie evergreeness).

@huumn huumn closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
@SatsAllDay
Copy link
Contributor Author

Ah, so basically someone who joined back in 10/21 (according to my graph screenshot) followed a referral link of mine at some point? Anyway, thanks for providing the context!

@huumn
Copy link
Member

huumn commented Apr 8, 2024

Ah, so basically someone who joined back in 10/21 (according to my graph screenshot) followed a referral link of mine at some point?

Exactly!

@SatsAllDay
Copy link
Contributor Author

Just to follow up here, I think what brought my attention to the referrals chart today is that I've received 3 push notifications indicating that someone joined SN using one of my referral links, which is a rarity for me. Am I seeing these push notifications more often due to the aforementioned commit? If so, we might want another ticket tracking updating the wording on the push notification, since it doesn't really mean a new user joined, but rather I became a user's most recent referrer (wording is hard 😅 )

Also, while I did receive push notifications, I did not see anything at /notifications, which seems incorrect, as well? I can open a separate issue for that, if you'd like.

@ekzyis
Copy link
Member

ekzyis commented Apr 9, 2024

If so, we might want another ticket tracking updating the wording on the push notification, since it doesn't really mean a new user joined, but rather I became a user's most recent referrer (wording is hard 😅 )

Makes sense to me

Also, while I did receive push notifications, I did not see anything at /notifications, which seems incorrect, as well? I can open a separate issue for that, if you'd like.

Sounds like a bug to me, too

@ekzyis
Copy link
Member

ekzyis commented Apr 9, 2024

Sounds like a bug to me, too

Bug happens because we assume that the referral was created at the time the user was created. So you don't see a notification in /notifications because it's considered to be a very old notification:

if (meFull.noteInvites) {
queries.push(
`(SELECT "Invite".id, MAX(users.created_at) AS "sortTime", NULL as "earnedSats",
'Invitification' AS type
FROM users JOIN "Invite" on users."inviteId" = "Invite".id
WHERE "Invite"."userId" = $1
AND users.created_at < $2
GROUP BY "Invite".id
ORDER BY "sortTime" DESC
LIMIT ${LIMIT})`
)
queries.push(
`(SELECT users.id::text, users.created_at AS "sortTime", NULL as "earnedSats",
'Referral' AS type
FROM users
WHERE "users"."referrerId" = $1
AND "inviteId" IS NULL
AND users.created_at < $2
ORDER BY "sortTime" DESC
LIMIT ${LIMIT})`
)
}

One way to fix this would be to store a separate timestamp for referrals.

@SatsAllDay
Copy link
Contributor Author

I opened #1046 and #1047 to track each of the subsequently identified issues from this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants