-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Added ability to notify and update url service about changes in related resources #10336
Added ability to notify and update url service about changes in related resources #10336
Conversation
I think this will work 🤩GREAT |
26ddf4d
to
8e5f6bb
Compare
e473730
to
9196b74
Compare
- nice side effect of this change is that we now have control over which events to respond to, so for example tags resouce wont be updated for API v1 as attachment events are not listened upon
5921a0a
to
a1ede86
Compare
One test needs to be fixed. Otherwise I think this PR is ready to go 🚀 |
whoop whooooop |
@@ -108,13 +108,13 @@ describe('Unit: services/url/Resources', function () { | |||
|
|||
should.exist(resources.getByIdAndType(options.eventData.type, options.eventData.id)); | |||
obj.tags.length.should.eql(1); | |||
Object.keys(obj.tags[0]).sort().should.eql(['id', 'slug'].sort()); | |||
Object.keys(obj.tags[0]).sort().should.eql(['id', 'post_id', 'slug', 'visibility'].sort()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
withRelatedFields
doesn't contain these fields, will look into the code itself to confirm why they are being returned here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a little investigation, looks like there is a bug in the current implementation of raw_knex.fetchAll
in the base model where these fields are not properly filtered on related tables. @kirrg001 I propose fixing this in a separate issue to be able to merge these changes sooner?
c26da2c
to
662f84d
Compare
d8f42f3
to
b791390
Compare
…s not working properly
b791390
to
5861c28
Compare
…of default 3000 on MySQL
bb709c3
to
5bcfdf5
Compare
- Resource service is now making asynchronous call to the db which causes lots of trouble synchronizing these tests properly
5bcfdf5
to
d0af733
Compare
@kirrg001 some of the tests were removed/skipped due to timeouts for test cases with a lot of state setup. This is due to the introduction of a db call in Resources service. There is this disconnection between the model layer and resources/urls/sitemaps services because they communicate through event emission. This doesn't allow checking if all operations that given event triggered have finished. This PR is needed for tomorrows release, so if you are back and well tomorrow morning, please give it another look 👍 Will do a bit more manual testing and self merge it if there are no objections. |
Did some more manual testing this morning. Nothing obvious came up, so merging it in :) |
refs #10124
This PR solves one of the existing bugs in referenced issue described here.
Still in progress:
published