Edgewall Software
Modify

Opened 14 years ago

Last modified 2 years ago

#7106 new defect

File attachment 'added' time is incorrect

Reported by: robert.nadler@… Owned by:
Priority: normal Milestone: next-major-releases
Component: attachment Version: devel
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Found in r6814.

The added time shown in the ticket is correct:

MTM1.log (1.6 kB) - added by admin 2 days ago.

but when you show the file, the added time is incorrect:

File MTM1.log, 1.6 kB (added by admin, 84 seconds ago)

The tool-tip timestamp is the same (and correct) on both.

Attachments (1)

trac_logo.png (5.5 KB ) - added by sid 14 years ago.
sample file to see if problem with timestamps can be replicated

Download all attachments as: .zip

Change History (5)

by sid, 14 years ago

Attachment: trac_logo.png added

sample file to see if problem with timestamps can be replicated

comment:1 by Christian Boos, 14 years ago

Milestone: 0.12

Yeah, it's because we're sending a 304 response in this case (trunk/trac/attachment.py@6980#L622).

Maybe we can use the same approach as for changesets here (i.e. the less than one hour ago trick, trunk/trac/versioncontrol/web_ui/changeset.py@6980#L295), so that we can at the same time show a valid information to the user and minimize the number of page reloads.

comment:2 by Thijs Triemstra, 11 years ago

Severity: normalmajor

comment:3 by Ryan J Ollos, 7 years ago

Owner: Christian Boos removed

in reply to:  1 comment:4 by Peter Suter, 4 years ago

Yeah, it's because we're sending a 304 response in this case (trunk/trac/attachment.py@6980#L622).

Maybe we can use the same approach as for changesets here (i.e. the less than one hour ago trick, trunk/trac/versioncontrol/web_ui/changeset.py@6980#L295), so that we can at the same time show a valid information to the user and minimize the number of page reloads.

I think this refers to the req.check_modified(attachment.date, ... cal:

This call (sending a 304 response) may allow the browser to show a previously cached page, which might contains the outdated timestamp.

But if something like this would also be added to the attachment template, then "84 seconds ago" would be shown as "less than one hour ago" instead. So the cached page wouldn't instantly become obsolete.

To ensure the browser stops using the cached page once it does become obsolete, pretty_timedelta(..., 3600) (resolution of 3600 seconds i.e. one hour) would be added to that check_modified call.

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.