You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2018/05/27 16:48:47 UTC

[whimsy] branch master updated: cache bust minutes display (Safari is notorioous for showing stale data)

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 938e3b9  cache bust minutes display (Safari is notorioous for showing stale data)
938e3b9 is described below

commit 938e3b9ce2f9ed8a627b1468cdb6521876c35192
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sun May 27 12:47:49 2018 -0400

    cache bust minutes display (Safari is notorioous for showing stale data)
---
 lib/whimsy/asf/agenda/minutes.rb           | 5 +++++
 www/board/agenda/views/models/agenda.js.rb | 2 +-
 www/board/agenda/views/pages/report.js.rb  | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/agenda/minutes.rb b/lib/whimsy/asf/agenda/minutes.rb
index 4e48e45..2020fbb 100644
--- a/lib/whimsy/asf/agenda/minutes.rb
+++ b/lib/whimsy/asf/agenda/minutes.rb
@@ -18,6 +18,11 @@ class ASF::Board::Agenda
       attrs['section'] = '3' + attrs['section'] 
       attrs['text'] = attrs['text'].strip
       attrs['approved'] = attrs['approved'].strip.gsub(/\s+/, ' ')
+
+      file = attrs['text'][/board_minutes[_\d]+\.txt/]
+      if file and File.exist?(File.join(FOUNDATION_BOARD, file))
+        attrs['mtime'] = File.mtime(File.join(FOUNDATION_BOARD, file)).to_i
+      end
     end
   end
 end
diff --git a/www/board/agenda/views/models/agenda.js.rb b/www/board/agenda/views/models/agenda.js.rb
index d048e85..ccb1f68 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -147,7 +147,7 @@ class Agenda
   end
 
   # provide read-only access to a number of properties 
-  attr_reader :attach, :title, :owner, :shepherd, :timestamp, :digest
+  attr_reader :attach, :title, :owner, :shepherd, :timestamp, :digest, :mtime
   attr_reader :approved, :roster, :prior_reports, :stats, :people, :notes
   attr_reader :chair_email, :mail_list, :warnings, :flagged_by
 
diff --git a/www/board/agenda/views/pages/report.js.rb b/www/board/agenda/views/pages/report.js.rb
index 8dadae2..e6b1269 100644
--- a/www/board/agenda/views/pages/report.js.rb
+++ b/www/board/agenda/views/pages/report.js.rb
@@ -79,7 +79,7 @@ class Report < Vue
         Server.drafts.include? "board_minutes_#{date}.txt"
       then
         Vue.set @@item, 'minutes', ''
-        retrieve "minutes/#{date}", :text do |minutes|
+        retrieve "minutes/#{date}?#{@@item.mtime}", :text do |minutes|
           @@item.minutes = minutes
         end
       end

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.