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

Don't omit history index when the value is 0 #1545

Merged
merged 1 commit into from
Jul 27, 2019
Merged

Don't omit history index when the value is 0 #1545

merged 1 commit into from
Jul 27, 2019

Conversation

dshulyak
Copy link
Contributor

closes: #1544

@status-github-bot
Copy link

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

@status-im-auto
Copy link
Member

status-im-auto commented Jul 26, 2019

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8332b24 #1 2019-07-26 05:33:47 ~42 sec linux 📦 zip
✔️ 8332b24 #1 2019-07-26 05:37:01 ~3 min ios 📦 zip
✔️ 8332b24 #1 2019-07-26 05:39:55 ~6 min android 📦 aar
✔️ 45895ef #2 2019-07-26 09:46:19 ~47 sec linux 📦 zip
✔️ 45895ef #2 2019-07-26 09:48:17 ~2 min ios 📦 zip
✔️ 45895ef #2 2019-07-26 09:51:19 ~5 min android 📦 aar

@@ -35,7 +35,7 @@ type Browser struct {
Name string `json:"name"`
Timestamp uint64 `json:"timestamp"`
Dapp bool `json:"dapp?"`
HistoryIndex int `json:"history-index,omitempty"`
HistoryIndex *int `json:"history-index,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be enough to remove omitempty? Or we still need to distinguish between 0 and no history index?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think it is correct to distinguish between 0 and no history. history index should be consistent with the history array. e.g. if there is no array or no items in array - history index 0 is confusing

Copy link
Contributor

Choose a reason for hiding this comment

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

In theory, no history might be considered that there is no history instead of looking at the index. I guess that would be the same? Just *int looks odd in this case but all is correct :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i guess it makes sense, a consumer will have to double check that index is not out of bounds anyway

@dshulyak dshulyak merged commit 6f1c2ec into develop Jul 27, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-omit branch July 27, 2019 05:48
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.

history-index is not returned by browser service
4 participants