- πΊπΈUnited States dcam
Postponing this on the resolution of π Convert the Feed hash to the State API Fixed . If that one makes it in, then this will be easier. Really, all we need to do is delete all of the hashes if the expire setting is updated. The only reason we have the hashes in the first place is for optimization, preventing feeds from being processed if they haven't changed.
I'm not sure if this is a bug either, but I can definitely agree that it's undesirable behavior and we need to make a change.
- Status changed to Active
over 1 year ago 3:27pm 13 September 2023 - πΊπΈUnited States dcam
The new state service is in, so this issue is unblocked.
I think we should add a description to the expire setting's form element that explains if it's changed, then it will cause all feeds to be completely reprocessed, potentially resulting in long wait times for imports on sites with large numbers of feeds.
- πΊπΈUnited States dcam
@larowlan I need your opinion on this. While I was creating the new state service I just assumed that eventually I'd add a
deleteAllHashes()
function in theItemsImporter
service to fix this issue. So I started writing it and quickly realized that I was adding a function for other classes to depend on, but it's not included in the interface. In fact, the service's hash functions should probably be protected except that the deprecated Feed functions say to use those instead. I haven't decided on a way to work around this, but I've come up with several options.- Add the hash functions to
ItemsImporterInterface
- This would be a BC break. And isn't necessarily a good idea anyway because the hash is a function of our default importer, not something overriding services should have to implement. - Add a
HashStorage
service that the importer and the settings form can both use. Then put the hash functions in it.
The deprecated Feed functions would be updated to point at these instead. - Add a more general state storage service that can be reused for the other Feed properties that we've talked about converting to state.
- To not overthink it and just let the settings form delete all the hashes.
I think all of the options have potential problems. I'd like to know what you think and if you have other ideas.
- Add the hash functions to
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
2 or 3 work for me, or a simple option is a variant of 1 where we add a new interface that ItemsImporter implements so we retain BC
eg SomeNewInterfaceThatSupportsDeletingHashes
class ItemImporter implements SomeNewInterfaceThatSupportsDeletingHashes, ItemImporterInterface
- Status changed to Needs review
over 1 year ago 5:10am 22 September 2023 - last update
over 1 year ago 158 pass - πΊπΈUnited States dcam
I've been thinking about this for days analyzing the options. I just can't see a way to do this by changing or adding an interface without potentially causing a problem. And once I realized that adding a service meant that we'd be adding a service to wrap our own service to fix its shortcomings I realized how ridiculous it sounded.
So I wrote a patch that implements option 4. The function to clear the hashes is short and sweet. I don't think it has any dependency issue and it's an OK solution. Please let me know what you think.
- last update
over 1 year ago 158 pass - πΊπΈUnited States dcam
The inline
@var
comment in the test referenced the wrong class. - Status changed to RTBC
about 1 year ago 12:54am 27 September 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
+++ b/src/Plugin/aggregator/processor/DefaultProcessor.php @@ -173,12 +186,27 @@ class DefaultProcessor extends AggregatorPluginSettingsBase implements Processor + $this->keyValue->get($id)->delete(ItemsImporter::AGGREGATOR_HASH_KEY);
was going to suggest we use deleteMultiple but then realised they're segmented by feed ID
Turned out fairly clean in the end
- Open on Drupal.org βCore: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22
21:41 21:20 Queued - Status changed to Fixed
about 1 year ago 2:04am 27 September 2023 - πΊπΈUnited States dcam
was going to suggest we use deleteMultiple but then realised they're segmented by feed ID
Right?! I was disappointed by that too.
- Status changed to Needs review
about 1 year ago 2:27am 27 September 2023 - last update
about 1 year ago 158 pass - πΊπΈUnited States dcam
I didn't mean to mark it as fixed until I'd patched 1.x, but #20 didn't apply.
- Status changed to Fixed
about 1 year ago 3:02am 27 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.