-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add post_baseUrl to delete on post, changes to logging #1050
Conversation
Test Results220 tests 212 ✅ 16s ⏱️ Results for commit 472427e. |
confused... if you are in a poll, you should just set baseUrl ... why do you need post_baseUrl? |
Because it eventually gets overridden later in the code. #951 For this plugin, For example, if the poll creates a message with Once the list of messages is returned from the poll, they get filtered in the flow algorithm. filter() calls updateFieldsAccepted(), which calls updatePaths(). And updatePaths has this logic: sarracenia/sarracenia/__init__.py Lines 790 to 800 in 9f61e90
If I don't set msg['post_baseUrl'], then we'd go into the elif case, because options.post_baseUrl is set (to the value of pollUrl from the config). This causes updatePaths to set msg['new_baseUrl'] to the value of options.post_baseUrl (== pollUrl). So now the message has been updated to be this:
Then finally, we get to this part of the code: sarracenia/sarracenia/flow/__init__.py Lines 517 to 522 in 47dd8dc
new_baseUrl is in m, and m['baseUrl'] and m['new_baseUrl'] are not equal, so this part of the code sets the value of baseUrl to whatever is in new_baseUrl. Now we have: There's a little bit of history missing from #951. This plugin used to work (see original code and examples here f1d7697) because I was leaving both pollUrl and post_baseUrl undefined in the config file. In that situation, we'd fall into the else on line 796 and updatePaths would not change the 'baseUrl' and 'new_baseUrl' fields in the message. But something changed between October 11, 2023 and now where the poll won't start if pollUrl is not set in the config file. I used to be able to set |
I also tried setting self.o.pollUrl and self.o.post_baseUrl in the poll, but that doesn't propagate to other parts of the code, because I think it has a deepcopy of the options, not the original instance used in other parts. |
Can you try putting self.o.add_option( 'pollUrl' , type='str', default='thevalueUwant' ) in the init ... |
I had made some changes that I forgot to push for #1042
The most important one is adding the post_baseUrl to the delete on post, so it doesn't propagate to the downloading component.