You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Last Modified date shows "next year" for new notebooks and existing notebooks soon after being saved, especially while
under a heavy processing load.
Reproduce
Create a new notebook:
Click on File > Save Notebook/Press CTRL+S/Click Save Button and save the notebook
Add some code that will take a long time to process, run it, and then click save:
Diagnosed and narrowed the issue down to Time.formatHuman function in jupyter/jupyterlab/packages/coreutils/src/time.ts. If you set a breakpoint after delta is calculated it is sometimes
a positive value. My guess is this is due to some asynchronous execution resulting in the save time appearing before the
Date.now() time.
With delta (s) being a positive value, the result of Math.ceil(delta / unit.milliseconds) for any of the units
will be 1. The first unit in the list is { name: 'years', milliseconds: 365 * 24 * 60 * 60 * 1000 } and thus with
amount being non-zero return formatter.format(amount, unit.name); on line 57 has the values 1, "year" and is formatted
to "next year".
A simple check to see if s is positive and return formatter.format(0, 'seconds'); if it is will resolve the issue and
a PR is to follow submitted by me; just wanted to get the issue documented first.
Expected behavior
Expect it to show "0 seconds" or "now" or whatever makes sense based on notebook language settings.
Context
Operating System and version: Debian GNU/Linux 12 (bookworm)
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋
Description
Last Modified date shows "next year" for new notebooks and existing notebooks soon after being saved, especially while
under a heavy processing load.
Reproduce
Diagnosed and narrowed the issue down to
Time.formatHuman
function injupyter/jupyterlab/packages/coreutils/src/time.ts
. If you set a breakpoint afterdelta
is calculated it is sometimesa positive value. My guess is this is due to some asynchronous execution resulting in the save time appearing before the
Date.now() time.
With
delta
(s
) being a positive value, the result ofMath.ceil(delta / unit.milliseconds)
for any of the unitswill be 1. The first unit in the list is
{ name: 'years', milliseconds: 365 * 24 * 60 * 60 * 1000 }
and thus withamount being non-zero
return formatter.format(amount, unit.name);
on line 57 has the values 1, "year" and is formattedto "next year".
A simple check to see if s is positive and return
formatter.format(0, 'seconds');
if it is will resolve the issue anda PR is to follow submitted by me; just wanted to get the issue documented first.
Expected behavior
Expect it to show "0 seconds" or "now" or whatever makes sense based on notebook language settings.
Context
Troubleshoot Output
Command Line Output
Browser Output
The text was updated successfully, but these errors were encountered: