Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-04-28 18:37:19 +0400
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-04-28 18:39:42 +0400
commitbd8b2b7fd98faf3308cb1f722426ff8f7c39f1d5 (patch)
treefea8f6bd28a675f84592ec8859c6221d89d82c3f /app/finders/notes_finder.rb
parentc685024951b8fed73ab05039baa170859ddf7b12 (diff)
Default last_fetched_at to 0 for old clients
Users who have not refreshed their browser tab will poll GitLab using outdated JS. This change makes the server fall back to the old behavior (send all comments) for old clients, instead of throwing an exception for old clients.
Diffstat (limited to 'app/finders/notes_finder.rb')
-rw-r--r--app/finders/notes_finder.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb
index 0b9affb716c..ea055694cd7 100644
--- a/app/finders/notes_finder.rb
+++ b/app/finders/notes_finder.rb
@@ -4,7 +4,8 @@ class NotesFinder
def execute(project, current_user, params)
target_type = params[:target_type]
target_id = params[:target_id]
- last_fetched_at = Time.at(params.fetch(:last_fetched_at).to_i)
+ # Default to 0 to remain compatible with old clients
+ last_fetched_at = Time.at(params.fetch(:last_fetched_at, 0).to_i)
notes = case target_type
when "commit"