Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorting in items.recent and items.feed #302

Closed
robotnic opened this issue Apr 4, 2015 · 8 comments
Closed

sorting in items.recent and items.feed #302

robotnic opened this issue Apr 4, 2015 · 8 comments

Comments

@robotnic
Copy link

robotnic commented Apr 4, 2015

Result is not proper sorted by date

Here an example result. See u16 at 2015-01-28T15:32:46.646Z.

Without proper sorting, the infinite scroll does not work.

[
    {
        "id": "f17e719a-5884-4764-8af1-38a50697bfd6",
        "node": "/user/[email protected]/posts",
        "entry": {
            "atom": {
                "title": "Post",
                "id": "tag:[email protected],/user/[email protected]/posts,f17e719a-5884-4764-8af1-38a50697bfd6",
                "updated": "2015-04-03T03:40:03.319Z",
                "published": "2015-04-03T03:40:03.319Z",
                "content": {
                    "content": "Click on the avatars on the right side to open personal node or chat.",
                    "type": "text"
                },
                "author": {
                    "name": "[email protected]",
                    "uri": "acct:[email protected]"
                }
            },
            "activity": {
                "verb": "post",
                "object": {
                    "object-type": "note"
                },
                "author": {
                    "object-type": "person"
                }
            }
        }
    },
    {
        "id": "3bf0aa64-c159-4db1-818d-f22e34ef8c9c",
        "node": "/user/[email protected]/posts",
        "entry": {
            "atom": {
                "title": "Post",
                "id": "tag:[email protected],/user/[email protected]/posts,3bf0aa64-c159-4db1-818d-f22e34ef8c9c",
                "updated": "2015-01-28T15:32:46.646Z",
                "published": "2015-01-28T15:32:46.646Z",
                "content": {
                    "content": "u16 test",
                    "type": "text"
                },
                "author": {
                    "name": "[email protected]",
                    "uri": "acct:[email protected]"
                }
            },
            "activity": {
                "verb": "post",
                "object": {
                    "object-type": "note"
                },
                "author": {
                    "object-type": "person"
                }
            }
        }
    },
    {
        "id": "21f5a056-5c67-44dc-9f55-896379e3aaac",
        "node": "/user/[email protected]/posts",
        "entry": {
            "atom": {
                "title": "Post",
                "id": "tag:[email protected],/user/[email protected]/posts,21f5a056-5c67-44dc-9f55-896379e3aaac",
                "updated": "2015-04-03T03:28:49.872Z",
                "published": "2015-04-03T03:28:49.872Z",
                "content": {
                    "content": "Franz",
                    "type": "text"
                },
                "author": {
                    "name": "[email protected]",
                    "uri": "acct:[email protected]"
                }
            },
            "activity": {
                "verb": "post",
                "object": {
                    "object-type": "comment"
                },
                "author": {
                    "object-type": "person"
                }
            },
            "in-reply-to": {
                "ref": "3bf0aa64-c159-4db1-818d-f22e34ef8c9c"
            }
        }
    },
    {
        "id": "09624673-7cb8-4204-9a94-c311220ae045",
        "node": "/user/[email protected]/posts",
        "entry": {
            "atom": {
                "title": "Post",
                "id": "tag:[email protected],/user/[email protected]/posts,09624673-7cb8-4204-9a94-c311220ae045",
                "updated": "2015-04-02T23:25:35.462Z",
                "published": "2015-04-02T23:25:35.462Z",
                "content": {
                    "content": "tttest",
                    "type": "text"
                },
                "author": {
                    "name": "[email protected]",
                    "uri": "acct:[email protected]"
                }
            },
            "activity": {
                "verb": "post",
                "object": {
                    "object-type": "note"
                },
                "author": {
                    "object-type": "person"
                }
            }
        }
    }
]
@robotnic
Copy link
Author

robotnic commented Apr 4, 2015

More details

That's the loading order at moment.

  • posting1 (10 Years old) //very old post with new child
    • posting100 (1 minutes)
  • posting97 (2 minutes)
  • posting98 (3 minutes)
  • posting99 (8 minutes)
....

Now load more items

Posting is loaded a second time because there is a child node.
...

  • posting1 (10 Years old) //old posting comes again because there is an other child.
    • posting80 (10 day)
  • .........

    Expected behaviour

    Load all childnodes together with the parent instead of only one childnode.

    The Problem

    At the moment it's not really possible to render the data.
    The childnodes should be rendered together with the parentnodes. If the user already scrolled the page, the childnode will be added at a place that is not visible for the user.
    But the content size is increasing and the visible part of the page jumps, which makes the page unreadable.

    A possibility would be, to show the parent item a second time. The problem here is, that it has the same id as before and it's not really addressable. (ng-repeat track by)

@lloydwatkin
Copy link
Member

It looks like you are using xmpp-ftw-buddycloud to handle retrieving of posts, what events are you using?

Infinite scroll does work, but in places the concepts of before and after with RSM (result set manangement, i.e. paging) do differ.

@lloydwatkin
Copy link
Member

@robotnic was this supposed to go in #301 ?

@robotnic
Copy link
Author

robotnic commented Apr 7, 2015

You are right lloyd.

@robotnic
Copy link
Author

Loading sequence

3:::{"type":0,"data":["xmpp.buddycloud.retrieve",{"node":"/user/[email protected]/posts","rsm":{"max":20}}],"id":5}

3:::{"type":0,"data":["xmpp.buddycloud.retrieve",{"node":"/user/[email protected]/posts","rsm":{"max":10,"after":"2e9f55b7-640c-4e50-858b-4bfa2a99e450"}}],"id":9}

Loading works without problem. I don't understand the message order. Best would be to see it live to understand the problem.

Backward scrolling will be funny thing - didn't implement that till now.

@lloydwatkin
Copy link
Member

If posts receive a comment / like then their updated date is updated in the database. This is to ensure they pop up earlier in the feel. This may appear to make posts appear to be loaded out of date order.

I've made some changes over the last few days for RSM as we're paging for https://github.com/project-isizwe/wifi-chat, suggest you try running the latest version of the server :)

@robotnic
Copy link
Author

I'm not able to install buddycloud-vm. The xmpp-ftw part does not start up. Same on hosting platform.

Here my newest app:
https://github.com/robotnic/angular-xmpp-comments

@robotnic
Copy link
Author

Problem is solved for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants