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

Reply By Tweet Bug Discussion #6085

Open
namangupta01 opened this issue Jul 30, 2019 · 37 comments
Open

Reply By Tweet Bug Discussion #6085

namangupta01 opened this issue Jul 30, 2019 · 37 comments
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed gsoc summer-of-code

Comments

@namangupta01
Copy link
Member

So I have figured out what the actual problem is after adding the console to print the mid way data in #6064.
The actual problem is short links.
parent tweet #<Twitter::Tweet:0x00005646ea71df68> parent tweet full text -> We’ve overhauled the entire https://t.co/PKr9eq2bkF website! Thanks to support from @GoogleOSS and contributors from five continents(!), we’re helping people around the world to better tell their stories through aerial mapping. Read all about it! https://t.co/nBXpX7hCHZ https://t.co/HClNdCS9y4 urls => ["https://t.co/PKr9eq2bkF", "https://t.co/nBXpX7hCHZ", "https://t.co/HClNdCS9y4"] node => node.nil? => true

Screen Shot 2019-07-31 at 3 42 55 AM

So here, https://t.co/nBXpX7hCHZ opens to https://publiclab.org/notes/warren/07-26-2019/community-atlas-an-around-the-world-collaboration-on-mapknitter where we have implemented the algo for the https://publiclab.org/n/20331.

node_id = redirected_url.split("/")[-1]

I guess we can try this once with a tweet with this kind of link https://publiclab.org/n/20331
If you want to see the logs, you can see at stable.publiclab.org/cron_log1.log
What do you think?

@namangupta01 namangupta01 added the bug the issue is regarding one of our programs which faces problems when a certain task is executed label Jul 30, 2019
@namangupta01
Copy link
Member Author

cc @jywarren , @gauravano

@namangupta01
Copy link
Member Author

Can @icarito @jywarren, please tell me what is the value of ENV["WEBSITE_HOST_PATTERN"] on stable? I need this for further debugging.

@namangupta01
Copy link
Member Author

@jywarren I tried on local with the same tweet. I was able to find node on local machine but same was not happening on production. I think it is something to do with the website host pattern env variable. Can anyone of @jywarren or @icarito let me know that what is the ENV["WEBSITE_HOST_PATTERN"] set on production? Is it //publiclab.org/n/?

Thanks

@jywarren
Copy link
Member

Hmm, yes it is! export WEBSITE_HOST_PATTERN=://publiclab.org/n/

@namangupta01
Copy link
Member Author

I checked the logs and yayy, I found this:
Screen Shot 2019-08-19 at 9 49 08 PM
We are able to get the node id and the only thing that I need is an email of user loggedin via twitter . But I am not getting any email for my twitter username -- I already have logged in via twitter. Its finding in the code here

def self.find_email(twitter_user_name)

Can you run this function from the rails console and find out if is there data for email : "[email protected]"?
-- We are very close this time, just need to find user email.

Thanks!!

@namangupta01
Copy link
Member Author

Also, can you delete the logs file or copy it somewhere else /public/cron_log1.log file on publiclab. Because this file is big and I need to download it very ofter after doing various reply by tweet.
The size is getting big is because of we are printing this data

puts "tweeter data -> #{data}"
.

@jywarren
Copy link
Member

Hi, @namangupta01 what query exactly should I run or what data should I look for? Comment. find_email() for your twitter handle?

@jywarren
Copy link
Member

If it's helpful, I've just logged in via twitter! https://publiclab.org/profile/warren/

@namangupta01
Copy link
Member Author

Yes! And also can you also try to run with your username as well?

@namangupta01
Copy link
Member Author

Can you run it with two of my usernames?

  1. itsmenamangupta
  2. NamanGu78470041

@jywarren
Copy link
Member

Comment.find_email('itsmenamangupta') returned nil, and Comment.find_email('NamanGu78470041') returned "[email protected]"

@namangupta01
Copy link
Member Author

Yes, this is the problem. This is what I was thinking.
The problem is the people who logged in before we started storing for users data in UserTag if not present there.

@jywarren
Copy link
Member

jywarren commented Aug 19, 2019 via email

@namangupta01
Copy link
Member Author

namangupta01 commented Aug 19, 2019 via email

@namangupta01
Copy link
Member Author

And also can you delete the file /cron_log1.log? Its is getting very big?

@jywarren
Copy link
Member

jywarren commented Aug 19, 2019 via email

@namangupta01
Copy link
Member Author

Yup we can do!

@jywarren
Copy link
Member

jywarren commented Aug 19, 2019 via email

@namangupta01
Copy link
Member Author

namangupta01 commented Aug 19, 2019 via email

@jywarren
Copy link
Member

jywarren commented Aug 19, 2019 via email

@namangupta01
Copy link
Member Author

Yay, It's working!!! 🎉 🎉
Screen Shot 2019-08-20 at 11 23 16 AM
Link here: https://publiclab.org/notes/mimiss/08-05-2019/trawling-with-babylegs-in-new-orleans-city-park
This was done by reply by tweet.

LOL, this was working all this time the only thing is that we were not doing reply by a tweet from the proper accounts. By proper accounts, I mean those accounts whose first login via twitter was done after we implemented this feature --as I said above.
Finally, it's working just have to solve the case with old accounts :)

@jywarren
Copy link
Member

jywarren commented Aug 20, 2019 via email

@namangupta01
Copy link
Member Author

Yes! This is working in production.

@namangupta01
Copy link
Member Author

Here's the tweet where I replied https://twitter.com/PublicLab/status/1159583447926677505

@namangupta01
Copy link
Member Author

In this tweet, it uses /n/___. But I am not sure about t.co but we can also test this out as well. And sure I will add the icon.

@jywarren
Copy link
Member

Great! I tweeted here: https://twitter.com/jywarren/status/1163852083747012609 but maybe mine is an old account?

@namangupta01
Copy link
Member Author

If Comment.find_email is able to find email from your user name then you can.

@jywarren
Copy link
Member

jywarren commented Aug 20, 2019 via email

@namangupta01
Copy link
Member Author

This is weird. If you have logged in via twitter then your twitter email and email on PublicLab is supposed to be same? Isn't it?

@namangupta01
Copy link
Member Author

I got this here in the logs:
Screen Shot 2019-08-20 at 11 43 51 PM

@namangupta01
Copy link
Member Author

Can you tell me how different email id case?

@namangupta01
Copy link
Member Author

Oh, I got it.

@namangupta01
Copy link
Member Author

Here's the fix jeff #6166

@jywarren
Copy link
Member

Hi @namangupta01 do you think you could remove the comments used in reply by tweet now?

@namangupta01
Copy link
Member Author

Sure!

@stale
Copy link

stale bot commented Oct 7, 2020

Hi 😄, this issue has been automatically marked as stale because it has not had recent activity. Don't worry you can continue to work on this and ask @publiclab/reviewers to add "work in progress" label 🎉 . Otherwise, it will be closed if no further activity occurs in 5 days -- but you can always re-open it if you like! 💯 Thank you for your contributions 🙌 🎈.

@stale stale bot added the stale label Oct 7, 2020
@jywarren jywarren removed the stale label Oct 8, 2020
@jywarren
Copy link
Member

jywarren commented Oct 8, 2020

Sorry about the stalebot message here, it was a mistake! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed gsoc summer-of-code
Projects
None yet
Development

No branches or pull requests

2 participants