Closed Bug 1094155 Opened 10 years ago Closed 10 years ago

[User Story] As a helper I can see my "solutions" rating as provided by Helpees so that I know how good I am against others.

Categories

(support.mozilla.org :: BuddyUp, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: atopal, Assigned: rik)

References

Details

(Whiteboard: p=1 s=bu.2014.4)

User Story

As a helper I can see my "solutions" rating as provided by Helpees so that I know how good I am against others.

Acceptance criteria:
* In the profile page, the helper can see the number of questions that helpees marked as solved through his comments
* This counter is updated each time the helper opens the profile page

Attachments

(1 file)

As a helper I can see my "solutions" rating as provided by Helpees so that I know how good I am against others.
Depends on: 1094313
User Story: (updated)
Whiteboard: p=1
Blocks: 1109642
Assignee: nobody → anthony
Status: NEW → ASSIGNED
I've splitted this in 3 commits for each part.
Attachment #8537822 - Flags: review?(schalk.neethling.bugs)
Two small questions, other than that, feel free to rebase and merge. I would like to get this landed before opening my next pull request.
Attachment #8537822 - Flags: review?(schalk.neethling.bugs) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Ok, so it seems I missed two things.

1) https://github.com/mozilla/buddyup/blob/948518933ffb4387123017e152bd97e45622d81a/app/js/sumo_db.js#L149
2) https://github.com/mozilla/buddyup/blob/948518933ffb4387123017e152bd97e45622d81a/app/js/sumo_db.js#L156

Should this not be:

.then(function(response) { return JSON.parse(response) });
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Ok so I see update_user in profile_controller 'fires and forgets' so, I guess there is no need to return anything for the moment right?

But get_user in SumoDB does need to return the response and not just JSON.parse as mentioned in comment 3
Flags: needinfo?(anthony)
Just FYI, I am working through all of this as part of my new pull request.
.then(JSON.parse) is equivalent to .then(function(r) { return JSON.parse(r); } )

See http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cscript%3E%0APromise.resolve%28%27{%22foo%22%3A%20%22bar%22}%27%29.then%28JSON.parse%29.then%28w%29%3B%0APromise.resolve%28%27{%22foo%22%3A%20%22bar%22}%27%29.then%28function%28r%29%20{return%20JSON.parse%28r%29}%29.then%28w%29%3B%0A%3C%2Fscript%3E

I've answered your two comments on the pull request.

So I don't think there's anything left to do, unless you have other comments.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Flags: needinfo?(anthony)
Resolution: --- → FIXED
(In reply to Anthony Ricaud (:rik) from comment #6)
> .then(JSON.parse) is equivalent to .then(function(r) { return JSON.parse(r);
> } )
> 
> See
> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!
> DOCTYPE%20html%3E%0A%3Cscript%3E%0APromise.
> resolve%28%27{%22foo%22%3A%20%22bar%22}%27%29.then%28JSON.parse%29.
> then%28w%29%3B%0APromise.resolve%28%27{%22foo%22%3A%20%22bar%22}%27%29.
> then%28function%28r%29%20{return%20JSON.parse%28r%29}%29.
> then%28w%29%3B%0A%3C%2Fscript%3E
> 
> I've answered your two comments on the pull request.
> 
> So I don't think there's anything left to do, unless you have other comments.

Ha! that's neat!
Whiteboard: p=1 → p=1 s=bu.2014.4
ni on Kadir - as discussed, "This counter is updated each time the helper opens the profile page" doesn't define the timeframe. This does happen with the current version, but not real time. If your acceptance criteria means it is supposed to update real time, then we need to track that part separately.
Flags: needinfo?(a.topal)
Anthony, what's the time frame here. How often is this updated? Is this an issue of caching?
Flags: needinfo?(anthony)
We cache the user profile for 15 minutes.
Flags: needinfo?(anthony)
I think in case we understand it caches, but we wanted clarification on whether the acceptance criteria was defining this as a real time update.
Flags: needinfo?(hcondei)
yes, the acceptance criteria was asking for this to be a real time update. I will open a different bug for this issue for later implementation
Flags: needinfo?(hcondei)
I filed bug 1145723 to track this.
Flags: needinfo?(a.topal)
Status: RESOLVED → VERIFIED
Depends on: 1145723
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: