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

Put settings in a table with schema #1746

Merged
merged 6 commits into from
Dec 27, 2019
Merged

Put settings in a table with schema #1746

merged 6 commits into from
Dec 27, 2019

Conversation

yenda
Copy link
Contributor

@yenda yenda commented Dec 18, 2019

Move settings table schema from a key-value store to a one row table with many columns.

We now save the first raw with initial data in saveAccountAndLogin and follow up saveSetting calls are only saving one setting at a time.

@status-github-bot
Copy link

status-github-bot bot commented Dec 18, 2019

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 Dec 18, 2019

Jenkins Builds

Click to see older builds (132)
Commit #️⃣ Finished (UTC) Duration Platform Result
4a8e579 #1 2019-12-18 20:11:21 ~39 sec android 📄log
✔️ 4a8e579 #1 2019-12-18 20:11:33 ~48 sec linux 📦zip
4a8e579 #1 2019-12-18 20:12:01 ~1 min ios 📄log
✔️ 4524e74 #2 2019-12-19 10:38:58 ~52 sec linux 📦zip
✔️ 4524e74 #2 2019-12-19 10:42:34 ~4 min ios 📦zip
✔️ 4524e74 #2 2019-12-19 10:43:57 ~5 min android 📦aar
✔️ 2ae0b60 #3 2019-12-19 11:22:14 ~42 sec linux 📦zip
✔️ 2ae0b60 #3 2019-12-19 11:24:55 ~3 min ios 📦zip
✔️ 2ae0b60 #3 2019-12-19 11:26:52 ~5 min android 📦aar
✔️ 9a15602 #4 2019-12-19 11:31:42 ~35 sec linux 📦zip
✔️ 9a15602 #4 2019-12-19 11:33:38 ~2 min ios 📦zip
✔️ 9a15602 #4 2019-12-19 11:36:30 ~5 min android 📦aar
✔️ 858a41e #5 2019-12-19 11:45:55 ~38 sec linux 📦zip
✔️ 858a41e #5 2019-12-19 11:47:55 ~2 min ios 📦zip
✔️ 858a41e #5 2019-12-19 11:50:36 ~5 min android 📦aar
✔️ 0334cbe #6 2019-12-19 12:08:22 ~36 sec linux 📦zip
✔️ 0334cbe #6 2019-12-19 12:10:15 ~2 min ios 📦zip
✔️ 0334cbe #6 2019-12-19 12:13:16 ~5 min android 📦aar
✔️ dc86270 #7 2019-12-19 12:32:56 ~37 sec linux 📦zip
✔️ dc86270 #7 2019-12-19 12:34:51 ~2 min ios 📦zip
✔️ dc86270 #7 2019-12-19 12:37:20 ~5 min android 📦aar
✔️ e57f4c5 #8 2019-12-19 13:10:24 ~41 sec linux 📦zip
✔️ e57f4c5 #8 2019-12-19 13:12:39 ~2 min ios 📦zip
✔️ e57f4c5 #8 2019-12-19 13:15:08 ~5 min android 📦aar
✔️ 2b01fdf #9 2019-12-19 14:03:02 ~40 sec linux 📦zip
✔️ 2b01fdf #9 2019-12-19 14:04:50 ~2 min ios 📦zip
✔️ 2b01fdf #9 2019-12-19 14:07:28 ~5 min android 📦aar
6a80955 #10 2019-12-19 15:02:05 ~22 sec ios 📄log
6a80955 #10 2019-12-19 15:02:07 ~26 sec android 📄log
✔️ 6a80955 #10 2019-12-19 15:02:27 ~42 sec linux 📦zip
✔️ 77dbcc1 #11 2019-12-19 15:03:52 ~36 sec linux 📦zip
✔️ 77dbcc1 #11 2019-12-19 15:05:44 ~2 min ios 📦zip
✔️ 77dbcc1 #11 2019-12-19 15:08:49 ~5 min android 📦aar
✔️ deb789f #12 2019-12-19 15:21:20 ~35 sec linux 📦zip
✔️ deb789f #12 2019-12-19 15:23:27 ~2 min ios 📦zip
✔️ deb789f #12 2019-12-19 15:25:50 ~5 min android 📦aar
✔️ 1af1559 #13 2019-12-19 15:29:53 ~36 sec linux 📦zip
✔️ 1af1559 #13 2019-12-19 15:31:41 ~2 min ios 📦zip
✔️ 1af1559 #13 2019-12-19 15:34:31 ~5 min android 📦aar
✔️ 65432fc #14 2019-12-19 15:42:25 ~39 sec linux 📦zip
✔️ 65432fc #14 2019-12-19 15:44:11 ~2 min ios 📦zip
✔️ 65432fc #14 2019-12-19 15:47:19 ~5 min android 📦aar
✔️ b63bbda #15 2019-12-19 16:10:50 ~36 sec linux 📦zip
✔️ b63bbda #15 2019-12-19 16:12:33 ~2 min ios 📦zip
✔️ b63bbda #15 2019-12-19 16:15:37 ~5 min android 📦aar
✔️ 69c511d #16 2019-12-19 16:13:35 ~35 sec linux 📦zip
✔️ 69c511d #16 2019-12-19 16:15:44 ~2 min ios 📦zip
✔️ 69c511d #16 2019-12-19 16:21:31 ~5 min android 📦aar
✔️ 75a1a33 #17 2019-12-19 16:26:27 ~38 sec linux 📦zip
✔️ 75a1a33 #17 2019-12-19 16:28:50 ~3 min ios 📦zip
✔️ 75a1a33 #17 2019-12-19 16:30:52 ~5 min android 📦aar
✔️ a601ad6 #18 2019-12-19 16:44:52 ~35 sec linux 📦zip
✔️ a601ad6 #18 2019-12-19 16:46:44 ~2 min ios 📦zip
✔️ a601ad6 #18 2019-12-19 16:49:18 ~5 min android 📦aar
✔️ 330dec8 #19 2019-12-19 17:08:58 ~36 sec linux 📦zip
✔️ 330dec8 #19 2019-12-19 17:11:02 ~2 min ios 📦zip
✔️ 330dec8 #19 2019-12-19 17:13:42 ~5 min android 📦aar
✔️ f04dcfc #20 2019-12-19 17:55:49 ~34 sec linux 📦zip
✔️ f04dcfc #20 2019-12-19 17:57:39 ~2 min ios 📦zip
✔️ f04dcfc #20 2019-12-19 18:00:22 ~5 min android 📦aar
✔️ 0eea903 #21 2019-12-19 18:51:44 ~45 sec linux 📦zip
✔️ 0eea903 #21 2019-12-19 18:53:27 ~2 min ios 📦zip
✔️ 0eea903 #21 2019-12-19 18:56:32 ~5 min android 📦aar
✔️ 818ba09 #22 2019-12-19 19:02:53 ~40 sec linux 📦zip
✔️ 818ba09 #22 2019-12-19 19:04:55 ~2 min ios 📦zip
✔️ 818ba09 #22 2019-12-19 19:07:11 ~5 min android 📦aar
✔️ 96cd9b0 #23 2019-12-19 19:36:49 ~42 sec linux 📦zip
✔️ 96cd9b0 #23 2019-12-19 19:38:38 ~2 min ios 📦zip
✔️ 96cd9b0 #23 2019-12-19 19:41:44 ~5 min android 📦aar
✔️ f284a79 #24 2019-12-19 19:37:46 ~31 sec linux 📦zip
✔️ f284a79 #24 2019-12-19 19:41:05 ~2 min ios 📦zip
✔️ f284a79 #24 2019-12-19 19:46:47 ~5 min android 📦aar
2f040c2 #25 2019-12-19 21:31:40 ~32 sec ios 📄log
✔️ 2f040c2 #25 2019-12-19 21:31:54 ~45 sec linux 📦zip
2f040c2 #25 2019-12-19 21:32:30 ~1 min android 📄log
✔️ 9078b4b #26 2019-12-19 21:36:50 ~34 sec linux 📦zip
✔️ 9078b4b #26 2019-12-19 21:39:04 ~2 min ios 📦zip
✔️ 9078b4b #26 2019-12-19 21:41:53 ~5 min android 📦aar
✔️ d348d9f #27 2019-12-20 09:52:56 ~36 sec linux 📦zip
✔️ d348d9f #27 2019-12-20 09:54:57 ~2 min ios 📦zip
✔️ d348d9f #27 2019-12-20 09:57:23 ~5 min android 📦aar
✔️ ca751a9 #28 2019-12-20 10:43:52 ~52 sec linux 📦zip
✔️ ca751a9 #28 2019-12-20 10:45:35 ~2 min ios 📦zip
✔️ ca751a9 #28 2019-12-20 10:52:13 ~9 min android 📦aar
✔️ 48cb208 #29 2019-12-20 10:47:07 ~41 sec linux 📦zip
✔️ 48cb208 #29 2019-12-20 10:48:51 ~2 min ios 📦zip
✔️ 48cb208 #29 2019-12-20 10:57:36 ~5 min android 📦aar
✔️ 5b28aa9 #30 2019-12-20 12:27:14 ~40 sec linux 📦zip
✔️ 5b28aa9 #30 2019-12-20 12:29:16 ~2 min ios 📦zip
✔️ 5b28aa9 #30 2019-12-20 12:31:54 ~5 min android 📦aar
✔️ 486d45c #31 2019-12-20 12:43:58 ~48 sec linux 📦zip
✔️ 486d45c #31 2019-12-20 12:45:57 ~2 min ios 📦zip
✔️ 486d45c #31 2019-12-20 12:48:25 ~5 min android 📦aar
✔️ 369da38 #32 2019-12-20 13:25:38 ~32 sec linux 📦zip
✔️ 369da38 #32 2019-12-20 13:27:30 ~2 min ios 📦zip
✔️ 369da38 #32 2019-12-20 13:30:07 ~5 min android 📦aar
✔️ cf556fc #33 2019-12-20 13:34:36 ~33 sec linux 📦zip
✔️ cf556fc #33 2019-12-20 13:36:41 ~2 min ios 📦zip
✔️ cf556fc #33 2019-12-20 13:39:03 ~5 min android 📦aar
✔️ 3a81962 #34 2019-12-20 13:36:40 ~42 sec linux 📦zip
✔️ 3a81962 #34 2019-12-20 13:39:17 ~2 min ios 📦zip
✔️ 3a81962 #34 2019-12-20 13:44:09 ~5 min android 📦aar
✔️ 4a1ebf3 #35 2019-12-20 14:56:46 ~2 min linux 📦zip
✔️ 4a1ebf3 #35 2019-12-20 14:59:20 ~4 min ios 📦zip
✔️ 4a1ebf3 #35 2019-12-20 15:03:37 ~9 min android 📦aar
✔️ cbe5ff0 #36 2019-12-20 15:04:42 ~51 sec linux 📦zip
✔️ cbe5ff0 #36 2019-12-20 15:07:19 ~3 min ios 📦zip
✔️ cbe5ff0 #36 2019-12-20 15:11:58 ~8 min android 📦aar
✔️ eff5cd7 #37 2019-12-20 15:30:50 ~57 sec linux 📦zip
✔️ eff5cd7 #37 2019-12-20 15:35:17 ~5 min ios 📦zip
✔️ eff5cd7 #37 2019-12-20 15:37:05 ~7 min android 📦aar
✔️ b1ff75f #38 2019-12-20 16:56:19 ~48 sec linux 📦zip
✔️ b1ff75f #38 2019-12-20 16:58:06 ~2 min ios 📦zip
✔️ b1ff75f #38 2019-12-20 17:02:18 ~6 min android 📦aar
✔️ 36f2faa #39 2019-12-20 17:01:08 ~38 sec linux 📦zip
✔️ 36f2faa #39 2019-12-20 17:03:03 ~2 min ios 📦zip
✔️ 36f2faa #39 2019-12-20 17:09:29 ~7 min android 📦aar
✔️ 90071b7 #40 2019-12-20 17:07:37 ~43 sec linux 📦zip
✔️ 90071b7 #40 2019-12-20 17:09:20 ~2 min ios 📦zip
✔️ 90071b7 #40 2019-12-20 17:16:45 ~7 min android 📦aar
✔️ 757deac #41 2019-12-20 22:01:16 ~55 sec linux 📦zip
✔️ 757deac #41 2019-12-20 22:02:54 ~2 min ios 📦zip
✔️ 757deac #41 2019-12-20 22:05:41 ~5 min android 📦aar
✔️ 3d3cab8 #42 2019-12-20 22:42:49 ~42 sec linux 📦zip
✔️ 3d3cab8 #42 2019-12-20 22:44:47 ~2 min ios 📦zip
✔️ 3d3cab8 #42 2019-12-20 22:47:30 ~5 min android 📦aar
✔️ 3d3cab8 #44 2019-12-21 12:38:45 ~51 sec linux 📦zip
✔️ 3d3cab8 #44 2019-12-21 12:40:28 ~2 min ios 📦zip
✔️ 3d3cab8 #44 2019-12-21 12:43:17 ~5 min android 📦aar
✔️ df7eb10 #43 2019-12-21 11:42:49 ~51 sec linux 📦zip
✔️ df7eb10 #43 2019-12-21 11:44:56 ~3 min ios 📦zip
✔️ df7eb10 #43 2019-12-21 11:49:09 ~7 min android 📦aar
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 15fb488 #45 2019-12-22 17:39:03 ~39 sec linux 📦zip
✔️ 15fb488 #45 2019-12-22 17:41:03 ~2 min ios 📦zip
✔️ 15fb488 #45 2019-12-22 17:43:45 ~5 min android 📦aar
✔️ a1e83f9 #46 2019-12-22 18:16:37 ~39 sec linux 📦zip
✔️ a1e83f9 #46 2019-12-22 18:18:26 ~2 min ios 📦zip
✔️ a1e83f9 #46 2019-12-22 18:21:41 ~5 min android 📦aar

api/backend_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@corpetty corpetty left a comment

Choose a reason for hiding this comment

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

There is also the os.MkdirAll issue from the audit (https://github.com/status-im/trailofbits-audit/issues/41). Maybe this should be a diff PR, but fixing the file permissions in this one is a start in the right direction.

appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
appdatabase/migrations/bindata.go Outdated Show resolved Hide resolved
@yenda yenda changed the title WIP put settings in a table with schema Put settings in a table with schema Dec 20, 2019
@yenda yenda self-assigned this Dec 20, 2019
multiaccounts/accounts/database.go Outdated Show resolved Hide resolved
multiaccounts/accounts/database.go Outdated Show resolved Hide resolved
multiaccounts/accounts/database.go Outdated Show resolved Hide resolved
@yenda
Copy link
Contributor Author

yenda commented Dec 20, 2019

@adambabik could you have a look? Ideally we'd want this branch to be merged today

@yenda
Copy link
Contributor Author

yenda commented Dec 20, 2019

@corpetty is your change still requested?

multiaccounts/accounts/database.go Show resolved Hide resolved
ChaosMode bool `json:"chaos-mode?,omitempty"`
Currency string `json:"currency,omitempty"`
CurrentNetwork string `json:"networks/current-network"`
CustomBootnodes *json.RawMessage `json:"custom-boot-nodes,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

json.RawMessage is alias of []byte so it's already a pointer because slices are pointers. json.RawMessage should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's because it's not just json.RawMessage it can also be nil, when calling getSettings if it's not a pointer you get:

        	Error:      	Received unexpected error:
        	            	sql: Scan error on column index 4, name "custom_bootnodes": unsupported Scan, storing driver.Value type <nil> into type *json.RawMessage

multiaccounts/accounts/database.go Show resolved Hide resolved
@adambabik adambabik merged commit 024f30f into develop Dec 27, 2019
@adambabik adambabik deleted the feature/settings3 branch December 27, 2019 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants