Opened 3 years ago

Closed 13 months ago

#5146 closed change (rejected)

[emscripten] Implement DownloadableSubscription.parseDownload()

Reported by: trev Assignee: hfiguiere
Priority: P3 Milestone:
Module: Core Keywords: closed-in-favor-of-gitlab
Cc: Blocked By: #5137
Blocking: #4122 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by hfiguiere)


In order to leave all text processing in C++ code, we need to process filter list downloads here as well.

What to change

Implement a new method DownloadableSubscription.parseDownload() as an extended replacement of FilterStorage.updateSubscriptionFilters(), to be called from Synchronizer._onDownloadSuccess and implement most of its logic. The method should return a _DownloadableSubscription_Parser instance:

  • buffer property is a pointer to the input buffer and bufferSize property its size (64kB?).
  • The buffer should be filled with lines of data followed by line breaks, until there is not enough space left for the next line or no more lines.
  • process(numChars) should be called to process the current buffer.
  • finalize() should be called in order to replace subscription filters. If delete() is called before finalize() the entire state is discarded and there is no effect on the subscription object.

There is a number of special cases here:

  • Filter list header: if invalid, subscription status should be set to synchronize_invalid_data and further input ignored - no filter replacement. Otherwise the version number from the header should be saved in requiredVersion property.
  • ! Checksum: comment: not saved as filter, checksum validation should be performed (MD5 implementation required). If it fails, status should be set to synchronize_checksum_mismatch and the filters not replaced. obsolete with issue 6849.
  • ! Redirect, ! Homepage, ! Title comments: value should be saved in the corresponding subscription field. This field needs to be added for redirects, its value should not be serialized and should be used as an indicator for Synchronizer that it needs to handle a redirect.
  • ! Expires comment: the value should be returned by finalize() so that Synchronizer can update the expiration data properly. If finalize() returns 0 the default expiration interval is used.
  • If filters are replaced, a notification with topic subscription.beforefiltersreplaced should be sent out before the list of filter changes and another with topic subscription.filtersreplaced after the new filters are in place. These notifications replace current subscription.updated notification.

Change History (9)

comment:1 Changed 3 years ago by trev

  • Description modified (diff)

comment:2 Changed 3 years ago by trev

  • Blocked By 5137 added

comment:3 Changed 3 years ago by hfiguiere

  • Owner set to hfiguiere

comment:4 Changed 3 years ago by hfiguiere

  • Review URL(s) modified (diff)

comment:5 Changed 3 years ago by oleksandr

  • Status changed from new to reviewing

comment:6 Changed 3 years ago by hfiguiere

  • Review URL(s) modified (diff)

comment:7 Changed 2 years ago by hfiguiere

  • Description modified (diff)

With issue 6849 and 6850 we don't need to deal with checksum anymore.

comment:8 Changed 23 months ago by hfiguiere

  • Review URL(s) modified (diff)

comment:9 Changed 13 months ago by sebastian

  • Keywords closed-in-favor-of-gitlab added
  • Resolution set to rejected
  • Status changed from reviewing to closed

Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.

Note: See TracTickets for help on using tickets.