soonaverse / app

The Soonaverse - Web3 platform for communities build on IOTA & Shimmer
https://soonaverse.com
Apache License 2.0
13 stars 10 forks source link

Fixes for member meta data fetch issues bug #139

Closed amenconi closed 8 months ago

amenconi commented 8 months ago

From issue description:

Bug Description: When the member page loads (any page with the member profile drawer open such as member activity, awards, spaces etc.) in some cases the member or spaces array returns malformed data (i.e. in the array of spaces you might find [object object] string instead of space meta data such as the UID and other properties). This will cause the Data Service to make invalid calls to the API and the HTML template will attempt to access UID property on objects where they don't exist.

Reproduce: Navigate to "https://soonaverse.com/member/0x3ffbc221b2215d6e7d9c863fb44616a1ae042017/badges" (one of my Soonaverse accounts) with dev tools console open and you will see some failed calls to API as well as number errors such as:

ERROR TypeError: Cannot read properties of undefined (reading 'uid')
    at DefaultIterableDiffer.trackByUid [as _trackByFn] (member-about.component.ts:67:17)
    at DefaultIterableDiffer.check (core.mjs:26476:36)
    at DefaultIterableDiffer.diff (core.mjs:26457:18)
    at NgForOf.ngDoCheck (common.mjs:3092:42)
    at callHook (core.mjs:2498:18)
    at callHooks (core.mjs:2457:17)
    at executeCheckHooks (core.mjs:2389:5)
    at selectIndexInternal (core.mjs:9147:17)
    at Module.ɵɵadvance (core.mjs:9136:5)
    at MemberAboutComponent_Template (member-about.component.html:152:10)

Expected behavior: Loading the page shouldn't produce any of these errors regardless of account loaded.

Screenshots Image: image Video: https://github.com/soonaverse/app/assets/7841580/54145a1c-2be2-4420-9446-3139c8633d57

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 122.0.6261.112
adamunchained commented 8 months ago

Great catch! Thanks @amenconi