Commit bd8b2b7fd98faf3308cb1f722426ff8f7c39f1d5
1 parent
c6850249
Exists in
spb-stable
and in
2 other branches
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.
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/finders/notes_finder.rb
... | ... | @@ -4,7 +4,8 @@ class NotesFinder |
4 | 4 | def execute(project, current_user, params) |
5 | 5 | target_type = params[:target_type] |
6 | 6 | target_id = params[:target_id] |
7 | - last_fetched_at = Time.at(params.fetch(:last_fetched_at).to_i) | |
7 | + # Default to 0 to remain compatible with old clients | |
8 | + last_fetched_at = Time.at(params.fetch(:last_fetched_at, 0).to_i) | |
8 | 9 | |
9 | 10 | notes = case target_type |
10 | 11 | when "commit" | ... | ... |