DoSomething / gladiator

:guardsman: The DoSomething.org competitions platform.
2 stars 0 forks source link

Display user info in leaderboard messages #409

Closed sbsmith86 closed 7 years ago

sbsmith86 commented 7 years ago

What's this PR do?

In #408, we fixed and issue sending leaderboard messages. However there still seemed to be an issue with the content of the message not pulling in the user names to the leaderboard. Example:

image

I am not fully sure when this was introduced, but it seems it might have been introduced when we started using Gateway for making calls to northstar. These calls return NorthstarUser objects, which we then appended activity to and cataloged for the leaderboard. Essentialy the leaderboard variable we sent to the message view was full of NorthstarUserobjects.

We are using Mail Queues to send these message, and queues do not allow objects to be passed to the view, it converts them to arrays, and it was stripping the NorthstarUser data when it did that.

The work around I came up with was to just create a smaller array with only the data we needed to use to display in the leaderboard. It's not pretty and, it's a bit of a hack. Going to try to schedule some time into my next sprint to clean some of this stuff up.

Leaderboard messages now:

image

How should this be manually tested?

We need to deploy to QA and TESSST

What are the relevant tickets?

Addresses #408

weerd commented 7 years ago

Just curious but would casting the (array) NorthstarUser object to an array help with resolving the references?

sbsmith86 commented 7 years ago

@weerd no that didn't seem to work I think because not all of the properties in the object are public.

weerd commented 7 years ago

Gotcha, ok. Good to know!