question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Safe Apps] Refactor how we store Safe app information in the origin field

See original GitHub issue

Title

Currently we encode the name and url into a json object and use it in the origin field. If the name or url are too long this will cause errors (see below).

To prevent this from happening we should refactor what is store in the origin field. The client gateway can then perform the appropriate logic to add the correct Safe app information to the reponse.

Proposals

URL only

Store the url of the app.

Schemas

Define custom schemas: ipfs -> ipfs://<ipfs_hash>

urls could just be used normally as their schema is https.

This would allow us to handle ipfs hashes better and not rely on a specific ipfs endpoint.

Note: This could be seen as an iteration on the URL only solution, as they are compatible.

Error Example

Obtained result

Post will error with 422 since we have a length limit of 100 chars on the origin field. This will also have the result that the transaction is not associated to the Safe app in the transaction list.

Data examples

Request: POST https://safe-transaction.staging.gnosisdev.com/api/v1/safes/0x74f8149a6Da9c0949f3e7415ae6591A2d45Dc9e9/transactions/

{
	"to": "0xB522a9f781924eD250A11C54105E51840B138AdD",
	"value": 0,
	"data": "0x8d80ff0a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000099003d2ed2f0b65c05b6670a619460eee61498f14b7f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000003d2ed2f0b65c05b6670a619460eee61498f14b7f000000000000000000000000000000000000000000000000000000000000000100000000000000",
	"operation": 1,
	"nonce": "1",
	"safeTxGas": 46430,
	"baseGas": 0,
	"gasPrice": 0,
	"gasToken": "0x0000000000000000000000000000000000000000",
	"refundReceiver": "0x0000000000000000000000000000000000000000",
	"contractTransactionHash": "0xf96687ec70c8161b689a2cdc375564a538c7683f12289a6657c884b774c66423",
	"transactionHash": "0x10d923174a3c31a1e0f2f6eff40fbb11f31746a9ba33de232d872980a2ef98d5",
	"sender": "0x05c85Ab5B09Eb8A55020d72daf6091E04e264af9",
	"origin": "{\"url\":\"https://ipfs.infura.io/ipfs/QmQBAygFq887bMhZV4P3rNbHCRQ8cYFhczSripKaprmYge\",\"name\":\"Create React App Sample\"}"
}

Response (422)

{"origin":["Ensure this field has no more than 100 characters."]}

Misc

This should handle/fix #1853

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
dasanracommented, Mar 31, 2022

This ticket was left behind for long. Currently there aren’t any heavy issues with this. If we refactor the way we store Safe Apps info in the backend is better to start over with a problem statment

0reactions
rmeissnercommented, Feb 4, 2021

It will be an empty name, but that doesn’t break anything overall … So it is minor

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Google Play Protect to help keep your apps safe and ...
Open the Google Play Store app Google Play . · At the top right, tap the profile icon. · Tap Settings. · Under...
Read more >
App Privacy Details - App Store
Learn about providing your app's privacy practice details in App Store ... This information is required to submit new apps and app updates...
Read more >
Security
The best way to make your app secure is to understand all of the possible inputs that could come from an untrusted source,...
Read more >
Review how your app collects and shares user data
The Play Console includes a Data safety form on the App content page. In this form, you explain to users which types of...
Read more >
Local History | PyCharm Documentation
Acting as your personal version control system, Local History lets you restore deleted files, bring back separate changes, or roll back to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found