parsav  Check-in [53ef86f7ff]

Overview
Comment:handle (some) deletions in live.js
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 53ef86f7ff464b62ad5c52c499ba9419385aebf5fc0bbc2725e4583375803347
User & Date: lexi on 2021-01-01 16:42:45
Other Links: manifest | tags
Context
2021-01-02
04:47
work on admin ui check-in: 7129658e1d user: lexi tags: trunk
2021-01-01
16:42
handle (some) deletions in live.js check-in: 53ef86f7ff user: lexi tags: trunk
16:24
move from webp to svg except where necessary check-in: aa17a03321 user: lexi tags: trunk
Changes

Modified route.t from [f59188addc] to [35b3cb0b8a].

   334    334   				}
   335    335   				goto [send]
   336    336   			end
   337    337   		end
   338    338   	end
   339    339   	terra http.static_content(co: &lib.srv.convo, [filename], [flen])
   340    340   		var hdrs = array(
   341         -		lib.http.header{'Content-Type',nil})
          341  +			lib.http.header{'Content-Type',nil},
          342  +			lib.http.header{'Cache-Control','max-age=2592000'} -- TODO immutable?
          343  +		)
   342    344   		var [page] = lib.http.page {
   343    345   			respcode = 200;
   344    346   			headers = [lib.mem.ptr(lib.http.header)] {
   345    347   				ptr = &hdrs[0], ct = 1
   346    348   			}
   347    349   		}
   348    350   		[branches]

Modified srv.t from [b74b4804fc] to [b092edff32].

   205    205   		lib.http.header { key = 'Cache-Control', value = 'no-store' },
   206    206   		lib.http.header {
   207    207   			key = 'X-Live-Newest-Artifact';
   208    208   			value = lib.math.decstr(lastup, &nbuf[20]);
   209    209   		},
   210    210   		lib.http.header { key = 'Content-Length', value = '0' }
   211    211   	)
   212         -	if self.live_last ~= 0 and self.live_last >= lastup then
          212  +	if self.live_last ~= 0 and self.live_last == lastup then
   213    213   		lib.net.mg_printf(self.con, 'HTTP/1.1 %s', lib.http.codestr(200))
   214    214   		for i = 0, [hdrs.type.N] do
   215    215   			lib.net.mg_printf(self.con, '%s: %s\r\n', hdrs[i].key, hdrs[i].value)
   216    216   		end
   217    217   		lib.net.mg_printf(self.con, '\r\n')
   218    218   	else
   219    219   		self:rawpage(200, pg, [lib.mem.ptr(lib.http.header)] {

Modified static/live.js from [15d09c6d9b] to [86bdd64b84].

    29     29   					'X-Live-Last-Arrival': container._liveLastArrival
    30     30   				}
    31     31   			})
    32     32   			
    33     33   			fetch(req).then(function(resp) {
    34     34   				if (!resp.ok) return;
    35     35   				let newest = parseInt(resp.headers.get('X-Live-Newest-Artifact'));
    36         -				if (newest <= container._liveLastArrival) {
           36  +				if (newest == container._liveLastArrival) { // != also handles some deletions
    37     37   					resp.body.cancel();
    38     38   					return;
    39     39   				}
    40     40   				container._liveLastArrival = newest
    41     41   
    42     42   				resp.text().then(function(htmlbody) {
    43     43   					var parser = new DOMParser();