Skip to content

Conversation

taooceros
Copy link
Member

@taooceros taooceros commented Jan 8, 2022

Watch Program and Bookmark file changes to trigger re-index

Tested on Windows [Version 10.0.19044.1949]:

  1. Chrome (v104.0.5112.102) bookmarks work
  2. Edge (v104.0.1293.70) bookmarks work
  3. Firefox (v104.0) bookmarks work
  4. Installing & removing UWP apps (Netflix, Snip & Sketch) installed from Microsoft Store work
  5. Installing & removing Win32 apps work (Firefox v104.0)

Close #688 #1336

@onesounds onesounds added the enhancement New feature or request label Jan 9, 2022
@onesounds onesounds added this to the 1.10.0 milestone Jan 9, 2022
@taooceros taooceros requested review from JohnTheGr8 and jjw24 January 13, 2022 23:31

public static void WatchPackageChange()
{
if (Environment.OSVersion.Version.Build >= 19041)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this condition needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same to uwp apps. Probably using main version higher than 10 is also good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry i am not following, main version as in Windows 10? why higher than 10 is good though?

if (!(_win32s.Any() && _uwps.Any()))
await indexTask;

Win32.WatchProgramUpdate(_settings);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you not also need to add WatchProgramUpdate for UWP apps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh I forget? I will check soon.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no. UWP are watched by package update

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comments

@jjw24
Copy link
Member

jjw24 commented Jan 27, 2022

Lets remove this mechanism

private static bool IsStartupIndexProgramsRequired => _settings.LastIndexTime.AddDays(3) < DateTime.Today;
now that we are adding the watcher in.

@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Jan 30, 2022
@taooceros
Copy link
Member Author

Lets remove this mechanism

private static bool IsStartupIndexProgramsRequired => _settings.LastIndexTime.AddDays(3) < DateTime.Today;

now that we are adding the watcher in.

Should we reindex on startup at background?

@taooceros
Copy link
Member Author

@taooceros I have been testing this, I can't get Win32 and uwp app change detections to work. Can you check please.

Finally get some workable free time. I will check now.

@taooceros
Copy link
Member Author

The firefox bookmark works partially when the bookmark is added to bookmark folder that is not the bookmark tool bar? I don't know how firefox handle that but if the bookmark is added to the toolbar, the sqlite file won't change.

@taooceros
Copy link
Member Author

@jjw24 I forget to reset cache when reindex. Now it should work (at least work for uwp).

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So after testing with the latest changes I am finding:

  1. Chrome bookmarks work
  2. Edge bookmarks work
  3. Installing & removing Win32 apps work
  4. Apps (UWP) installed from Microsoft Store do not work
  5. Firefox boomarks does not work at all

@taooceros getting close :)

@taooceros
Copy link
Member Author

@jjw24 what's your uwp version? We are using a relatively new winrt api so probably that won't work in earlier version? (just similar to the windows notification)

@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Mar 1, 2022
@jjw24
Copy link
Member

jjw24 commented Mar 2, 2022

I tested with Snip & Sketch via Microsoft's App Store.

Does it work for you? What UWP app did you test?

@taooceros
Copy link
Member Author

I tested with Snip & Sketch via Microsoft's App Store.

Does it work for you? What UWP app did you test?

Sorry I mean the windows version.

@taooceros
Copy link
Member Author

I tested with Snip & Sketch via Microsoft's App Store.

Does it work for you? What UWP app did you test?

I test it with netflix.

@taooceros
Copy link
Member Author

Would you mind take a debug on whether the events are triggered if that doesn't work?

@taooceros
Copy link
Member Author

I wonder probably we can make the reindex faster by deleting the uninstalled entry/adding new entry. But the current way is good enough for now since it is unlikely that it will requires a lot of resources.

@jjw24 jjw24 added the review in progress Indicates that a review is in progress for this PR label Aug 21, 2022
@jjw24
Copy link
Member

jjw24 commented Aug 29, 2022

The firefox bookmark works partially when the bookmark is added to bookmark folder that is not the bookmark tool bar? I don't know how firefox handle that but if the bookmark is added to the toolbar, the sqlite file won't change.

With Firefox (v104.0) bookmarks, I have found when a bookmark is added or removed, the surest way that places.sqlite will get updated is when you close all Firefox browser. Occasionally it may update after adding/ removing a bookmark. Chrome and Edge on the other hand their file get updated almost instantly after adding/removing a bookmark. This is fine with Firefox as it is beyond our control when the places.sqlite file get updated.

@jjw24
Copy link
Member

jjw24 commented Aug 29, 2022

Tested on Windows [Version 10.0.19044.1949]:

  1. Chrome (v104.0.5112.102) bookmarks work
  2. Edge (v104.0.1293.70) bookmarks work
  3. Firefox (v104.0) bookmarks work
  4. Installing & removing UWP apps (Netflix, Snip & Sketch) installed from Microsoft Store work
  5. Installing & removing Win32 apps work (Firefox v104.0)

@jjw24 jjw24 changed the title Reindex when app install or deleted (and uwp update). Auto re-index for Program and Bookmark plugins Aug 29, 2022
jjw24
jjw24 previously approved these changes Aug 29, 2022
@jjw24 jjw24 enabled auto-merge August 29, 2022 21:08
@jjw24 jjw24 removed the review in progress Indicates that a review is in progress for this PR label Aug 29, 2022
@jjw24 jjw24 merged commit c74eafb into dev Aug 29, 2022
@jjw24 jjw24 deleted the filewatcher branch August 29, 2022 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

[Can't find the newly added bookmarks]

3 participants