-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature request: Expose the currently indexing item to js #10
Comments
@hessius: I am curious: how many items do you plan to put into the index? A new function could be introduced to pull the info how many items are remaining to be indexed. I did such a change for a different plugin (unzip a folder and copy files ) as the activity was very time-intensive. I am not sure how time-intensive the indexing is. Therefore my question |
@MarcoEidinger |
The current used iOS API allows only a completionHandler which makes it difficult for the plugin to handle the feature request. Essentially the plugin would need to do introduce and handle a batch logic. iOS offers batch processing an special API (see https://developer.apple.com/reference/corespotlight/cssearchableindex) but the plugin would need to take more responsibility (consider and protect concurrent access from multiple threads). My current advise would be that the consumer of the plugin will call the setItems function with smaller data portion which comes down to batch handling on the consumer side. @johanblomgren should judge as plugin owner |
Smart! In my experience the completion handler is delayed a couple of seconds compared to what would be expected looking at the console output, if one were to split the items into 10 or 20 parts that would mean a whole lot of extra time. I'll have to test and see |
@MarcoEidinger Precisely - the plugin would need to take into consideration multithreaded access and it would introduce more complexity. Also, callbacks invoking JavaScript functions on the WebView will not be reliable if at all work when the app is running in the background (which may cause issues if one relied on such a callback to for example hide a spinner/progress bar). One could introduce another callback for reporting back current indexing progress when the app returns from the background.. but then again, we're introducing a lot of complexity. However, I agree with @hessius that such a feature (i.e. continuous callbacks) would be helpful for reacting to indexing state. I'll see if I can investigate the delay you're mentioning - there should be none. |
Currently the console outputs the currently indexing items directly in xcode, would be great if this could be exposed in js as well, both for conditionals but also to be able to determine (and show) progress
The text was updated successfully, but these errors were encountered: