Calling social:reload adds duplicates to the social items

RESOLVED FIXED in M3

Status

Pancake
Front-end
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: st3fan, Assigned: sfoster)

Tracking

unspecified
x86
Mac OS X

Details

(Reporter)

Description

6 years ago
When the pull-to-refresh is done, the ios app sends social:reload to the FE. It correctly goes to twitter and facebook to grab new items but it incorrectly just prepends them to the current items. Instead it should only add new items that are not already on the page.
(Reporter)

Comment 1

6 years ago
If the iOS app needs to send a different call to the FE then that is of course also possible. Since we already use social:reload to notify the FE about changes in the social settings. Not sure if that is the cause.
(Assignee)

Comment 2

6 years ago
Do we want to fetch more (additive) or refresh the list? social:reload sounds like we want to empty the existing list and repopulate it by fetching again. So stuff currently on the screen may go away.
(Reporter)

Comment 3

6 years ago
Maybe start with a simple refresh and do something more sophisticated with the social items later? LIke we could add a 'more tweets' button at the bottom, things like that.

Updated

6 years ago
Assignee: nobody → sfoster
(Assignee)

Comment 4

6 years ago
Seems like the pull-to-refresh in the main window currently fully reloads the app - top, main and drawer is that right?
(Reporter)

Comment 5

6 years ago
Hmm it only sends a reload to the main webview. Not to any of the others.

Btw if the page reload is not a good idea then it is easy to revert back to the app sending a command to the FE instead.
(Assignee)

Comment 6

6 years ago
The behavior we want here is for refresh of whatever-is-currently-on-the-screen. 
So, searches should be re-submitted, social feeds refreshed, etc. 

Commits: 
https://bitbucket.org/mozillapancake/pancake/changeset/bc64aa3677a1
https://bitbucket.org/mozillapancake/pancake/changeset/a0b20598e90d

.. wire a handler for a 'refresh' message to make this so for the home screen (top_stacks + social) and the search (search/search+terms). If we sendMessage('main', 'refresh', [{}]) from the pull-to-refresh gesture, it should do what we want.
Assignee: sfoster → sarentz
(Reporter)

Comment 7

6 years ago
When I send refresh to main I get the following error:

2012-06-05 14:32:54.527 PancakeDevelopment[15591:f803] LOG - MAIN - "main (ios): handling  xmessage: refresh"
2012-06-05 14:32:54.528 PancakeDevelopment[15591:f803] LOG - MAIN - "main: xmessage, calling handler: onRefresh"
2012-06-05 14:32:54.529 PancakeDevelopment[15591:f803] LOG - MAIN - "refresh instruction received, reload: undefined"
2012-06-05 14:32:54.536 PancakeDevelopment[15591:f803] LOG - MAIN - "main: refresh result: \"null\""

I have committed this change anyway, so that you can update your iOS app to test it.
(Reporter)

Updated

6 years ago
Assignee: sarentz → sfoster
(Assignee)

Comment 8

6 years ago
I reinstated the social:reload message handler in main-bb, so toggling social services in the account menu will now refresh the social feed (and the top stacks too). 

The error messages you saw aren't really errors, just logging. I've fixed it so we don't get that undefined and also made the xmessage return value logging conditional on there being a return value at all.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 9

6 years ago
See changeset: https://bitbucket.org/mozillapancake/pancake/changeset/f19b02957150

(In reply to Sam Foster [:sfoster] from comment #8)
> I reinstated the social:reload message handler in main-bb, so toggling
> social services in the account menu will now refresh the social feed (and
> the top stacks too).
You need to log in before you can comment on or make changes to this bug.