History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2174
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Robin Shen
Reporter: Lukasz Guminski
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

REST Query build notifications by statusDate

Created: 09/Sep/14 07:44 PM   Updated: 11/Sep/14 12:53 AM
Component/s: None
Affects Version/s: 5.1.33
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Current REST API for query for build notifications is missing ability to query _incrementally_.

"last_notified_build_id" option is not sufficient, as when you query with e.g "last_notified_build_id=1", you get a list of builds with ids with gaps e.g. 1, 2, 5, and you don't know if builds 3 and 4 haven't yet completed, or you just have access rights to them, and you will never get notification on them.

So you don't know if next time you can query with last_notified_build_id=5 (because you will never get notifications about 3 and 4 due to permissions) or you should re-query with last_notified_build_id=1 (because the build are still running)

Instead there should last_status_date parameter, so that you could query for all notifications on builds that completed (either successfully or failed depending on your notification settings) after a specified date.



 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [10/Sep/14 01:32 AM]
If users do not have permission to access a build, they should not get the notification. So the incremental search should be working here.

Lukasz Guminski [10/Sep/14 09:53 AM]
Rob, you misunderstood me. I am sorry that I haven't explained the situation clearly.

What you said is true
"If users do not have permission to access a build, they should not get the notification."

The problem is different. Imagine a situation:

User asks for notifications (/notifications?last_notified_build_id=1 ) and gets a response
  <id>1</id>
  <id>2</id>
  <id>5</id>

in this moment it is unclear what she should do next.

* if next time she will query with last_notified_build_id=5, it might happen that she will miss notifications on builds 3 and 4.
     It can happen when user has permissions to see 3 and 4, but they completed after build 5.

* if instead she decides to keep on querying with last_notified_build_id=1, than it might happen that she will finally get a complete list 1, 2, 3, 4, 5.

     But it can also happen that user does not have permissions to see 3, 4. So she can query with last_notified_build_id=1 till the end of the world, and she will never get complete list. But she doesn't know that, so he keeps on querying.

The first case already shows that incremental querying doesn't work. You can loose notifications with the current approach. Unless I don't understand how it works, which is also possible..


Robin Shen [11/Sep/14 12:53 AM]
QB server will order notifications by the time they happen, instead of by id. So if 3 and 4 finishes after 5, the notification order will be 1 2 5 3 4, so next querying with last_notified_id=5 will get you 3 and 4.