Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy all from OM Calender doesn't always copy all items for the day #1513

Closed
jasonjac2 opened this issue Jul 30, 2024 · 11 comments · Fixed by #1531
Closed

Copy all from OM Calender doesn't always copy all items for the day #1513

jasonjac2 opened this issue Jul 30, 2024 · 11 comments · Fixed by #1531
Assignees
Labels
bug Something isn't working released Available in a released installer

Comments

@jasonjac2
Copy link
Sponsor

Problem to Solve

Cal in cal mode, not list mode.
Did it for today and it gave me 24 entries.
Did it for yesterday and it gave me 1, i.e. the last on in the list.

image
in the month view.
Clicked the Copy All links for day

From log: 01|10:51:47.817| Starting OneMoreCalendar
01|10:52:12.229| copying 24 hyperlinks from 30/07/2024 00:00:00
01|10:52:40.924| copying 1 hyperlinks from 29/07/2024 00:00:00
01|10:53:01.698| copying 1 hyperlinks from 29/07/2024 00:00:00
01|10:53:22.190| copying 1 hyperlinks from 29/07/2024 00:00:00

Changed the settings (to make the list refresh)
went to yesterday 1st. scrolled the list for the day (more than can fit in the cell)
Clicked the copy
it then gave me the full list
checking the log...
01|10:59:18.465| copying 44 hyperlinks from 29/07/2024 00:00:00

So it appears to be linked to the second time you click copy maybe?

Environment (if applicable)

Version 6.5.0 with OneNote 16.0.17726.20160

Additional Context

Add any other context about the problem here. Attach page XML file or the app log file as appropriate. You can find the log file here: %localappdata%\temp\OneMore.log

THE FINE PRINT This is a hobby project that I started for myself. I'm happy to take requests and will promise to
consider each one carefully but offer no guarantees that I will ultimately agree to their
usefulness or have time to implement any of them. If OneNote offers a "close enough" work-around
then I will probably reject the request - you've been warned!

@jasonjac2 jasonjac2 added bug Something isn't working unread I have seen it or had time to refine it yet labels Jul 30, 2024
@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Jul 30, 2024
@stevencohn
Copy link
Owner

Has the calendar app been open for since early yesterday, before you updated those missing pages?

Haven't been able to repro this. When you navigate to a month, it captures a list of pages updated for each day. If you click Copy for a day, it does capture a cache of updated pages for that day. If you then update more pages, the cache is not updated until you navigate away from that month and then back. I can remove this cache, making it only slightly (milliseconds) to copy pages for a day. But I'm not sure I understand the exact workflow here to repro.

@stevencohn
Copy link
Owner

Full disclosure, the cache can be improved to fix this. I'll take that on...

@jasonjac2
Copy link
Sponsor Author

I can reproduce on two machines (logged into same accounts). I have only just stumbled accross it, so testing is limited. I just tried on another machine and got the same outcome.
28th has about 10 items, 29th 44 items, 30th about 25 items.

Its like it is picking up the last entry from the day before sometimes.

It feels to me like a poorly initialised "start of list" pointer.

@jasonjac2
Copy link
Sponsor Author

doing you a quick streams vid if that's ok, can't share it here though.

@stevencohn
Copy link
Owner

stevencohn commented Jul 30, 2024

Cheers.
The problem is pointed out by the comment here

That "been here before" assumption should never have been made :-(

@jasonjac2
Copy link
Sponsor Author

sent you over an expiring streams link.

@stevencohn
Copy link
Owner

Thanks for that. I need to emulate a ton a updates. I normally update only a few pages per day.

You need a Copy Month command or export ;-)

@jasonjac2
Copy link
Sponsor Author

  • would love a "day view", not the list, but a day view with a next / prev / goto date.

      		// if we have at least one Hyperlink then we've been here before!
      		if (!day.Pages.Exists(p => p.Hyperlink is not null))
    

How do you read this (trying to say it out loud so it makes sense).

@stevencohn
Copy link
Owner

day is model describing the calendar day.
day.Pages is the list of pages described by a page model
day.Pages.Exists looks for at least one page that matches the criteria
p.Hyperlink is not null means a page that has a hyperlink set

So it's only looking for one and then stopping. The assumption made by the comment is what I described above, where you load the month view and see n pages and click Copy to load hyperlinks for those pages, then update more pages; without navigating or refreshing the view, Calendar will not attempt to load hyperlinks for the subsequently updated pages because it sees that at least one has already been loaded. Unfortunately, after seeing your video, this may be red herring and I'll have to dig deeper.

Repository owner deleted a comment from stevenmcohn Jul 30, 2024
@jasonjac2
Copy link
Sponsor Author

Thanks for the explanation and hope the video helped.
it's the p => that got me. Is it kind of a p is a place holder to the items in the pages collection and then you it is checking the condition, a bit like "foreach pages"

@stevencohn
Copy link
Owner

C# has lambda expressions, just "syntactical sugar, smoke and mirrors" as Anders Hejlsberg once said.

things.Exists(x => x.foo == 123)

is roughly the same as

var found = false;
foreach (var x in things) 
{
    if (x.foo == 123) 
   {
       found = true;
       break; 
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants