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

Synchronise Sticker Pack setting fields #13193

Closed
Samyoul opened this issue Mar 22, 2022 · 0 comments · Fixed by status-im/status-go#2674 or #13358
Closed

Synchronise Sticker Pack setting fields #13193

Samyoul opened this issue Mar 22, 2022 · 0 comments · Fixed by status-im/status-go#2674 or #13358
Assignees
Labels
feature feature requests syncing Syncing or pairing

Comments

@Samyoul
Copy link
Member

Samyoul commented Mar 22, 2022

Implement functionality that handles the syncing of the stickers/packs-installed, stickers/packs-pending and stickers/recent-stickers settings.

Background

In status-go syncing of settings has been implemented, and additional setting sync should be a relatively straightforward process. The initial work for syncing of the stickers/packs-installed, stickers/packs-pending and stickers/recent-stickers settings has been implemented on the status-go side.

See status-im/status-go#2478 and #13053

NOTE: Issue 8 has been resolved, however additional work needs to be done on these setting fields to get robust behaviour:

In my initial work on syncing sticker packs the syncing seemed to work, sometimes the stickers didn't appear, but the space where the stickers should appear was there. I don't know if this was an issue with my implementation or my dev env or what exactly. That'll be your job 🛠️

An additional thing to consider is the handling of differences between the sticker pack data payloads.

  • Example: stickers/packs-installed may contain 3 sticker packs on device A and 4 sticker packs on device B, and both sets have 2 sticker packs in common and the other sticker packs are unique to their respective devices. What should happen when syncing this data?
  • A potential solution would be to combine the data into a merged set

status-go Implementation

Currently the stickers/packs-installed, stickers/packs-pending and stickers/recent-stickers setting have their sync functionality disabled:

StickersPacksInstalled = SettingField{
	reactFieldName: "stickers/packs-installed",
	dBColumnName:   "stickers_packs_installed",
	valueHandler:   JSONBlobHandler,
	// TODO resolve issue 8 https://github.com/status-im/status-react/pull/13053#issuecomment-1065179963
	syncProtobufFactory: &SyncProtobufFactory{
		inactive:          true, // Remove after issue is resolved
		fromInterface:     stickersPacksInstalledProtobufFactory,
		fromStruct:        stickersPacksInstalledProtobufFactoryStruct,
		valueFromProtobuf: BytesFromSyncProtobuf,
		protobufType:      protobuf.SyncSetting_STICKERS_PACKS_INSTALLED,
	},
}
StickersPacksPending = SettingField{
	reactFieldName: "stickers/packs-pending",
	dBColumnName:   "stickers_packs_pending",
	valueHandler:   JSONBlobHandler,
	// TODO resolve issue 8 https://github.com/status-im/status-react/pull/13053#issuecomment-1065179963
	syncProtobufFactory: &SyncProtobufFactory{
		inactive:          true, // Remove after issue is resolved
		fromInterface:     stickersPacksPendingProtobufFactory,
		fromStruct:        stickersPacksPendingProtobufFactoryStruct,
		valueFromProtobuf: BytesFromSyncProtobuf,
		protobufType:      protobuf.SyncSetting_STICKERS_PACKS_PENDING,
	},
}
StickersRecentStickers = SettingField{
	reactFieldName: "stickers/recent-stickers",
	dBColumnName:   "stickers_recent_stickers",
	valueHandler:   JSONBlobHandler,
	// TODO resolve issue 8 https://github.com/status-im/status-react/pull/13053#issuecomment-1065179963
	syncProtobufFactory: &SyncProtobufFactory{
		inactive:          true, // Remove after issue is resolved
		fromInterface:     stickersRecentStickersProtobufFactory,
		fromStruct:        stickersRecentStickersProtobufFactoryStruct,
		valueFromProtobuf: BytesFromSyncProtobuf,
		protobufType:      protobuf.SyncSetting_STICKERS_RECENT_STICKERS,
	},
}

To reactivate the stickers/packs-installed, stickers/packs-pending and stickers/recent-stickers functionality in status-go simply remove the inactive field from the SyncProtobufFactorys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature requests syncing Syncing or pairing
Projects
None yet
3 participants