Skip to content

Update push activity and push details views to query _PushStatus #378

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

Merged
merged 4 commits into from
May 26, 2016

Conversation

JeremyPlease
Copy link
Contributor

Originally Parse Dashboard used some custom endpoints to Parse for fetching push notifications and statuses. Now, the "_PushStatus" class in Parse Server can be queried directly when using the master key. From what I can tell, this has been available since Parse Server v2.2.8.

There's still a lot of stale/unused code regarding push notifications (experiments, audiences, push opens, scheduled pushes, etc.). I'm not sure what (if any) of those features will eventually be implemented, so I kept most of that code untouched.

This pull request gives the basic functionality of:

  1. Viewing the list of all pushes with the "load more" button for loading more.
  2. The detailed view of individual pushes to show pushes sent and targeting.

One thing to note is that Parse Server has a "source" of "rest" for all push notifications right now. So, all push notifications in the dashboard will have a "type" of "api" in the list view. Parse Server will need some updates to accept the "source" as part of Parse.Push.send(...).

Please try this out with your Parse Server apps and let me know if you have any problems, suggestions, comments, or feedback. Thanks!

_PushStatus class in Parse Server can be queried directly when using the master key.
This allows us some basic functionality of viewing push history and statuses.
@facebook-github-bot
Copy link

By analyzing the blame information on this pull request, we identified @drew-gross, @gavrix and @durunvo to be potential reviewers.


if (features.push && features.push.storedPushData) {
if (features.push && parseServerVersion >= '2.2.8') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are trying to avoid inspecting the server version directly, and instead adding info to the serverInfo endpoint in Parse Server to let the dashboard know that new features are available. Could you do that instead?

This particular check would also start to fail once we get to 2.10.0 or etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I'll change back to features.push.storedPushData and submit a PR to Parse Server to update that value.

And, yeah, version string comparison 😞

@drew-gross
Copy link
Contributor

Wow this looks awesome! Just a few suggestions then we can merge this. We are going to do a new release of Parse Server soon so any changes that need to be made there will be able to go out quickly.

@facebook-github-bot
Copy link

@JeremyPlease updated the pull request.

JeremyPlease added a commit to JeremyPlease/parse-server that referenced this pull request May 26, 2016
It's assumed that when push is available, the pushHandler is used and data is saved in _PushStatus.
This allows Parse Dashboard push history to be enabled: parse-community/parse-dashboard#378
@JeremyPlease
Copy link
Contributor Author

Thanks, @drew-gross! Everything should be good to go with this PR and the referenced PR in Parse Server.

drew-gross pushed a commit to parse-community/parse-server that referenced this pull request May 26, 2016
…1923)

It's assumed that when push is available, the pushHandler is used and data is saved in _PushStatus.
This allows Parse Dashboard push history to be enabled: parse-community/parse-dashboard#378
@drew-gross
Copy link
Contributor

Great. We can get this into a release shortly after the next Parse Server version.

@drew-gross drew-gross merged commit 9b5dfb0 into parse-community:master May 26, 2016
@JeremyPlease
Copy link
Contributor Author

@drew-gross I saw the recent release of a new Parse Server version. Any schedule/plan for the next release of Parse Dashboard?

Thanks!

@drew-gross
Copy link
Contributor

Want to review #390? Then I can do a release.

@drew-gross
Copy link
Contributor

^ @JeremyPlease

@MattiaConfalonieri
Copy link

After update at last version (Parse dashboard and Parse server) Past Pushes in the dash infinite load and don't show nothing... have i to set something in the server?

@JeremyPlease
Copy link
Contributor Author

@MattiaConfalonieri everything works as expected for me (screenshot).

Two questions for you:

  1. What's in your browser's dev tool network log on that page? Are the pushes being fetched properly and are there any errors in the console.
  2. Could you export the data in your _PushStatus collection in mongodb and attach it here? Perhaps there is something in your pushes that's not being handled correctly by dashboard.

@MattiaConfalonieri
Copy link

MattiaConfalonieri commented Jun 2, 2016

@JeremyPlease thanks for reply and sorry if i am so newbie
my push work properly without problem and u i can see push sent in parse.com dash with 0 sent. (but i have many recipient)

here log error on the dash page

[Error] TypeError: n.indexOf is not a function. (In 'n.indexOf("Z")', 'n.indexOf' is undefined)
    le (dashboard.bundle.js:38:2207)
    value (dashboard.bundle.js:38:5000)
    (funzione anonima) (dashboard.bundle.js:38:6913)
    map
    value (dashboard.bundle.js:38:6882)
    value (dashboard.bundle.js:1:15587)
    _renderValidatedComponentWithoutOwnerOrContext (dashboard.bundle.js:50:16768)
    _renderValidatedComponent (dashboard.bundle.js:50:16896)
    _updateRenderedComponent (dashboard.bundle.js:50:16229)
    _performComponentUpdate (dashboard.bundle.js:50:16029)
    updateComponent (dashboard.bundle.js:50:15306)
    performUpdateIfNecessary (dashboard.bundle.js:50:14738)
    performUpdateIfNecessary (dashboard.bundle.js:7:14677)
    s (dashboard.bundle.js:5:19711)
    perform (dashboard.bundle.js:9:17852)
    perform (dashboard.bundle.js:9:17852)
    perform (dashboard.bundle.js:5:20775)
    k (dashboard.bundle.js:5:20947)
    (funzione anonima)
    closeAll (dashboard.bundle.js:9:18489)
    perform (dashboard.bundle.js:9:17939)
    batchedUpdates (dashboard.bundle.js:51:8343)
    l (dashboard.bundle.js:5:19983)
    r (dashboard.bundle.js:29:23910)
    enqueueSetState (dashboard.bundle.js:29:24701)
    setState (dashboard.bundle.js:29:9522)
    (funzione anonima) (dashboard.bundle.js:38:2946)
    s (dashboard.bundle.js:4:24070)
    value (dashboard.bundle.js:4:23430)
    (funzione anonima) (dashboard.bundle.js:4:24141)
    s (dashboard.bundle.js:4:24070)
    (funzione anonima) (dashboard.bundle.js:4:24683)
    u (dashboard.bundle.js:4:24486)
    value (dashboard.bundle.js:4:24664)
    s (dashboard.bundle.js:4:24114)
    value (dashboard.bundle.js:4:23430)
    s (dashboard.bundle.js:4:24197)
    value (dashboard.bundle.js:4:23430)
    s (dashboard.bundle.js:4:24197)
    value (dashboard.bundle.js:4:23430)
    (funzione anonima) (dashboard.bundle.js:4:24141)
    s (dashboard.bundle.js:4:24070)
    value (dashboard.bundle.js:4:23430)
    onreadystatechange (dashboard.bundle.js:46:26776)

@MattiaConfalonieri
Copy link

Any idea? how i can solve the problem?

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

Successfully merging this pull request may close these issues.

4 participants