The YT bug

Updated over 4 years ago by Thomas Ochman

So we have a bug in the application that causes the project videos not being pulled in. Have a look on the videos tab in WSO and you know what I mean. No videos are being pulled in for that project. On the other hand LocalSupport videos are working correctly. That tells me that the methods in `lib/youtube_videos.rb` are working (at least partially)

The problem seems to be with the array that is created by `project.members_tags` 

I wrote up some methods that I run manually in order to test what could possibly be wrong. 

  def validate_project_videos(project)
    project.members_tags.each do |user|
      begin
         u = User.where(youtube_user_name: user.titleize).first
         uri = URI.parse("http://gdata.youtube.com/feeds/api/users/#{u.youtube_id}")
         request = Net::HTTP.get(uri)
         if request == "User not found"
           puts "Something wrong with #{u.display_name}".red
         else
           puts "#{u.display_name} is all good".green
         end
      rescue
          puts "Whats up with #{user.titleize}?"
      end      
    end    
  end

and for checking individual users:

  def validate_user_videos(user)
    uri = URI.parse("http://gdata.youtube.com/feeds/api/users/#{user.youtube_id}")
    request = Net::HTTP.get(uri)
    if request == "User not found"
      puts "Something wrong with #{user.display_name}".red
    else
      puts "#{user.display_name} is all good".green
    end
  end

There is a difference in how many project followers have `youtube_id`'s and `youtube_user_name`'s
wso.members.select(&:youtube_user_name).map(&:youtube_user_name).count
=> 36
wso.members.select(&:youtube_id).map(&:youtube_user_name).count => 38
(these numbers has since changed after I removed some followers...)

If I grab the same array that is generated for LocalSupport and build (by modifying `lib/youtube_videos.rb:35` <= `build_request_for_project_videos(project)` ) the request for WSO, I get a valid response. I also get one if i make a call without any users, (that returns a lot of not WSO related videos) so it must be the array that is the root of the problem.  

So, this is a big problem as the recordings of sessions is one of the core elements of AV. Anybody that want to spend some time with me on this will be greatly rewarded! ;-)

Revisions

comments powered by Disqus