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

Fixes actions payload continuously appending #718

Merged
merged 6 commits into from
Jul 6, 2023
Merged

Conversation

karynemayer
Copy link
Contributor

Fixes #697

Description

This PR fixes the issue where the content of an action is continuously appended to the table with the following changes:

  1. Custom check to identify if the data is the same as received in the previous request
    Why? The request answer sometimes includes keys that are empty and sometimes it doesn't. The diff below illustrates the difference between the request payloads. Fun fact, they also change the order of the attributes, which is not depicted in the example below.
    How? We recursively compare the each key since we can't predict the kind of data it will be. We ignore any key that has zero content in the comparison, so the objects are considered the same.
 {
        "data": {
            "permission": "active",
            "parent": "owner",
            "auth": {
                "threshold": 2,
-
+              "keys": [],
                "accounts": [
                  {
                      "permission": {
                          "actor": "captaincrypt",
                          "permission": "active"
                      },
                      "weight": 1
                  },
              ],
-            
+           "waits": [],
          },
          "account": "tf"
      }
  },
  1. Created a new component responsible for showing the payload
    Why? Due to the complexity of the data that can come from the blockchain actions, a new component with the sole purpose of showing this data was created. It leverages recursion because of the lack of predictability on the JSON that comes from the endpoints and makes sure we show a simplified, indented version of the content.

Note that we don't print the information again if it was deemed equal to the previous one.

Test scenarios

Tested on the following transactions:

  • The original one : /transaction/9398eb3fd65179086d2cb571a82299fe16ac545a4724952f3d4dc8f1dd53fcac
  • /transaction/cb0bc295eab73a01b931463e57f932774a59cddc804acab5e28112845ea4b2d1
  • /transaction/e058a43cf19d2f736d60cddc046329b179d04fab5121eacce14db7f4db043341 Note that the content key issue will be addressed in another PR/issue
  • /account/eosio.evm

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have cleaned up the code in the areas my change touches
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have removed any unnecessary console messages
  • I have included all english text to the translation file and/or created a new issue with the required translations for the currently supported languages
  • I have tested for mobile functionality and responsiveness
  • I have added appropriate test coverage

@netlify
Copy link

netlify bot commented Jun 26, 2023

Deploy Preview for obe-testnet ready!

Name Link
🔨 Latest commit 2b3398c
🔍 Latest deploy log https://app.netlify.com/sites/obe-testnet/deploys/64a72c31b3a7fb00072b74f3
😎 Deploy Preview https://deploy-preview-718--obe-testnet.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jun 26, 2023

Deploy Preview for obe-staging ready!

Name Link
🔨 Latest commit 2b3398c
🔍 Latest deploy log https://app.netlify.com/sites/obe-staging/deploys/64a72c31acfb310008fd3781
😎 Deploy Preview https://deploy-preview-718--obe-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Show resolved Hide resolved
src/components/transaction/DataFormat.vue Outdated Show resolved Hide resolved
src/components/transaction/DataFormat.vue Outdated Show resolved Hide resolved
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 27, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2b3398c
Status: ✅  Deploy successful!
Preview URL: https://19b0c060.open-block-explorer.pages.dev
Branch Preview URL: https://updateauth-bug.open-block-explorer.pages.dev

View logs

let currentData = ref<string | unknown>(null);
const maxHeight = 57; // the maximum row height
const switchHeight = 20;
const maxHeightStyle = computed(() =>
Copy link
Contributor

@donnyquixotic donnyquixotic Jul 6, 2023

Choose a reason for hiding this comment

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

this doesn't need to be computed() since the values don't change or need to be reactive. optionally you could remove the switchHeight variable which isn't used elsewhere and just have const maxHeightStyle = 37px // comment whichever you prefer for readability.

Suggested change
const maxHeightStyle = computed(() =>
const maxHeightStyle = `calc(${maxHeight}px - ${switchHeight}px)`;

<div class="text-weight-bold">memo:&nbsp;<span class="text-weight-regular" v-if="transferData.memo">{{transferData.memo}}</span><span class="text-weight-regular" v-else>n/a</span></div>
<div
class="relative-position"
:class="{'overflow-hidden': !showOverflow, 'div-compressed': !showOverflow}"
Copy link
Contributor

Choose a reason for hiding this comment

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

double-check this but I believe the quasar class overflow-hidden is redundant now due to div-compressed (doesn't appear to do anything when disabled in dev tools)

Suggested change
:class="{'overflow-hidden': !showOverflow, 'div-compressed': !showOverflow}"
:class="{ 'div-compressed': !showOverflow }"

src/components/transaction/DataFormat.vue Show resolved Hide resolved
@donnyquixotic donnyquixotic merged commit 52f6530 into develop Jul 6, 2023
@donnyquixotic donnyquixotic deleted the updateauth-bug branch July 6, 2023 21:13
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.

Continuous Updateauth Data Growth with Live Updates Enabled on OBE Testnet Explorer Account or Tx View
3 participants