Comments (11)
I've got why to filter there. It's because we use this code for getting a list of projects, not only for getting one project.
We can think what would be a good fix there.
from taas-apis.
@maxceem good catch, we need to discuss
from taas-apis.
So the issue here is because we are calling searchResourceBookings(criteria)
which returns 20 results per page by default. As we calling this method without specifying the project id, we are getting more resources for all the projects, which is more than 20. But as we get only the 1st page, we get some random set of resources.
First of all, this method should support filtering by multiple project ids, so we can get resources only for some projects which we are showing on the main page of taas app, not all projects as we do now.
The second task is to get all of the resources for the selected projects, not only 20.
We could set some big perPage
value when calling searchResourceBookings(criteria)
, but potentially we may want to limit the maximum perPage
in our API, which would break it again.
So instead of increasing perPage
which can get broken, we may add some extra argument for searchResourceBookings(criteria)
like internallyReturnAll
searchResourceBookings(criteria, internallyReturnAll)
. Which would force the method to return all the records and ignoring perPage
(don't set it for requests from ES and DB).
from taas-apis.
@imcaizheng feel free to pick this up if you like.
If you have any better ideas on how to fix this issue, please let me know.
from taas-apis.
@maxceem How about directly querying DB for resources instead of invoking searchResourceBookings(criteria)
? I think it is more common to retrieve data internally inside a service.
from taas-apis.
Thanks, @imcaizheng, I forgot to consider such an option. Though it also has its disadvantage - we would mix data from ES and from DB. I'm not sure if it could lead to real issues and data inconsistency, but it feels like not the right thing to do. Also, I've noticed that in the TaaS API we always get data from ES so far (with DB fallback). The same I can see in Challenge API https://github.com/topcoder-platform/challenge-api/blob/develop/src/services/ChallengeService.js#L18-L20.
So let's adapt the method searchResourceBookings
which gets data from ES, so we can reuse it for our needs.
from taas-apis.
@maxceem Agreed.
from taas-apis.
PR created #56
from taas-apis.
Contest https://www.topcoder.com/challenges/30158247 has been created for this ticket.This is an automated message for maxceem via Topcoder X
from taas-apis.
Contest https://www.topcoder.com/challenges/30158247 has been updated - it has been assigned to aaron2017.This is an automated message for maxceem via Topcoder X
from taas-apis.
Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30158247This is an automated message for maxceem via Topcoder X
from taas-apis.
Related Issues (20)
- [$100] Some notifications are not received HOT 33
- [$50] Replace webhook which listens to created events HOT 4
- Interview Improvements - Summary
- [$75] Fix updating interview method on webhooks HOT 14
- [$75] Use `metadata` to identify Nylas update events instead of parsing `description` HOT 2
- Issue when connecting Google/Microsoft calendar and then removing it HOT 12
- Interview scheduled email is not sent
- [$50] Add authentication for a new Nylas Page webhook. HOT 5
- [$80] Send interview "canceled" and interview "rescheduled" email notifications HOT 12
- [$30] Use existent env variable during DB migration HOT 5
- Some interviews are stuck in scheduling, therefore unable to cancel/reschedule them HOT 3
- Attendees are not listed in the Interview reminder(customer), Interview complete(customer) and Reminder: Take action to reserve your talent(customer) emails HOT 2
- [$40] The meeting link sent to the JC in the 'Reminder: Interview coming up' email says 'You do not have permissions to perform this action' HOT 14
- Add a new `Did not Post` rcrmStatus to the taas-api HOT 1
- Migration Open Jobs which are only present on Gigs Listing MFE
- The email notification 'before 1 hour of interview time' and the 'Post Interview Action Reminder' notification are not received HOT 1
- [Prod] Interview confirmation email notification is not sent sporadically HOT 4
- Download resume email was not received HOT 2
- Cancel interview doesn't work - Interview is not getting canceled and no emails sent HOT 3
- Internal server error while trying to schedule an interview
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taas-apis.