← Back to team overview

launchpad-dev team mailing list archive

"thanks" microservice

 

I had a play with Google plusone integration for Launchpad on the
weekend[1].  It was interesting; I'm glad I did; it would also be a
bit of a problem to actually deploy in terms of both user privacy and
commercial confidentiality, and Launchpad has just decided/realized it
has a policy against running third party js in page.

Having done this, I have an idea about how to do a "thankyou" feature
within Launchpad.  I think that would be a really nice thing when you
consider how much of Launchpad's content is collaboration and
cooperation.  Obviously people can already post eg messages saying
"thanks" in many contexts, but that is a bit noisy, and experience
shows more people will express appreciation if they have an almost
nonverbal way to do it.

I am still going to try to land more html metadata improvements that
will let people better share lp pages using external tools if they
want to.

Inspired by the notification description here is how I think this
could work as a microservice:

There is a button ("thanks" or thumbs up) on various objects for which
someone might express appreciation: ppas, products, bugs, bug
comments, mp comments, etc.

There is a table in a separate service of (person_name, person_url,
thanked_url).

There is a microservice that provides these operations:

  give_thanks(person_name, person_url, url) - add a row
  get_thanks(person, url) - called by this person (or null), return
    - whether the current user thanked that object
    - how many people thanked it in total
    - a possibly truncated list of some people who thanked it

There are thin api shims in the webapp that pass external requests
through to the service after
  - mapping the current user to a person url
  - checking the current user has access to the relevant url

There is js in the client that
 - draws a button
 - queries the service to find out whether it should be drawn selected
or not for the current user, and a count/list to show in a tooltip
 - only on public pages
 - updates the button and sends a ping to give_thanks when clicked

I don't think this is the most important thing at the moment but I
thought I'd write it down while it's fresh and while we're talking
about that sort of thing.

[1] https://code.launchpad.net/~mbp/launchpad/798412-plusone/+merge/83449

-- 
Martin


Follow ups