condenser icon indicating copy to clipboard operation
condenser copied to clipboard

UpdateProps of community settings is rejected by Hivemind as invalid

Open only-dev-time opened this issue 11 months ago • 7 comments

Updating the community props with custom_json op contains the field settings which is an empty object if no image has been set.

Example

Mention by user: https://steemit.com/@event-horizon/sp64bx Transaction: https://steemworld.org/block/91602709/91602709-13 grafik

Hivemind

Hivemind doesn't accept empty objects in the fields:

INFO:hive.indexer.community:validating @hive-117153 op ['updateProps', {'community': 'hive-117153', 'props': {'title': 'ارتقاء', 'about': 'Invitation only community for progressive desi.', 'settings': {}, 'is_nsfw': False, 'lang': 'en', 'description': '', 'flag_text': ''}}]
WARNING:hive.indexer.notify:[NOTIFY] error - src None dst 1923595 pid None (key `settings` was blank) cid None (35/100)

link to the check: https://github.com/only-dev-time/hivemind/blob/33204e1c2a18551acdb60e0a6142d1e2a4983d71/hive/indexer/community.py#L89

Analysis

With #3927 in SettingsEditButton.jsx the field settings was added to the props for the custom_json: https://github.com/only-dev-time/steem_condenser/commit/0da5aa368f902cde01a02e36d6992a08e4875cc5#diff-0b3b832a35933fe6e6ab1230a31131d076a671c39806fc56863578bcdcb39e83R100

@the-gorilla-steem Could a check that no images has been set solve the problem?

only-dev-time avatar Dec 28 '24 09:12 only-dev-time

I've been working on a fix for this and in doing so, I broke Hivemind. So ety001 fixed Hivemind. Which appears to have fixed the issue with community images updating. Would you mind checking and confirming this for me please?

the-gorilla-steem avatar Jan 14 '25 10:01 the-gorilla-steem

@the-gorilla-steem I would check this, but where can I see your changes?

only-dev-time avatar Jan 14 '25 13:01 only-dev-time

@only-dev-time - the Hivemind update has already been put live so it's available on steemit.com. It appears that I don't need to update condenser.

the-gorilla-steem avatar Jan 14 '25 22:01 the-gorilla-steem

@the-gorilla-steem I tested it with DU. The error still exists (I removed the old cover url before): https://steemworld.org/block/92144888/92144888-2

INFO:hive.indexer.community:validating @moecki op ['updateProps', {'community': 'hive-146118', 'props': {'title': 'Deutsch Unplugged', 'settings': {}, 'is_nsfw': False, 'lang': 'de'}}]
WARNING:hive.indexer.notify:[NOTIFY] error - src None dst 737242 pid None (key `settings` was blank) cid None (35/100)

The fix for Hivemind concerns avatar_url, as there is a separate field for this in the community table. This must not be None. This has been fixed.

The still existing problem is that the field settings must not be empty if it is contained in the costum_json op. This still happens if cover_url and avatar_url are undefined.

only-dev-time avatar Jan 15 '25 15:01 only-dev-time

@only-dev-time - Could you please check that this issue was resolved with the most recent release?

Additional logic was included in the Community Settings to ensure that the 'settings' object is not empty.

the-gorilla-steem avatar Mar 18 '25 10:03 the-gorilla-steem

@the-gorilla-steem I updated my condenser and tried to save community settings with empty fields Profile picture url and Cover image url.

Image

Then it throws this error:

Uncaught TypeError: settingsCopy.avatar_url is undefined
    onSubmit https://steemit.moecki.online/assets/app.56309b6f953d657fef84.js:76331
    onSubmit https://steemit.moecki.online/assets/app.56309b6f953d657fef84.js:76323
    invokeGuardedCallback https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:43057
    executeDispatch https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:42887
    executeDispatchesInOrder https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:42910
    executeDispatchesAndRelease https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:26162
    executeDispatchesAndReleaseTopLevel https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:26173
    forEachAccumulated https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:70054
    processEventQueue https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:26373
    runEventQueueInBatch https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:113979
    handleTopLevel https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:113989
    handleTopLevelImpl https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:116960
    perform https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:35434
    batchedUpdates https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:71620
    batchedUpdates https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:15548
    dispatchEvent https://steemit.moecki.online/assets/vendor.56309b6f953d657fef84.js:117035

only-dev-time avatar Apr 02 '25 20:04 only-dev-time

@the-gorilla-steem I added some suggestions to your commit.

only-dev-time avatar Apr 07 '25 18:04 only-dev-time