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

Cannot edit old comment on Research module, at least in some cases #3511

Open
pizzaisdavid opened this issue May 8, 2024 · 1 comment
Open

Comments

@pizzaisdavid
Copy link
Contributor

pizzaisdavid commented May 8, 2024

Description
As a user, I want to edit an old comment of mine because I realized I made a typo.

Steps to reproduce the behaviour:
Because this issue relies on having an old comment I am not sure how to reliably reproduce it for testing, but here is what we know:

The user mavigogun tries to edit their comment on this post, update 7, but it doesn't save. Specifically the comment dated 03-08-2023, I can't say if trying to edit the other comment works or doesn't work.

Expected behaviour
The comment is updated with the new content.

Additional context
Relevant information from the console log reported:

Uncaught (in promise) Error: Error: Comment not editable by user

click here for more of the stacktrace

source: https://discord.com/channels/586676777334865928/1237309179937689625/1237812823971860490

@pizzaisdavid
Copy link
Contributor Author

Interestingly this error also appears when running the unit tests, but the test still passes. I am unsure if that is intentional

PASS src/stores/Discussions/discussion.store.test.ts (1850 MB heap size)
  ● Console

    console.log
      2024-05-11 19:28:39.592   ERROR
       Error  Discussion not found
      error stack:
        • discussions.store.tsx DiscussionStore.addComment
        /src/stores/Discussions/discussions.store.tsx:85
        • discussion.store.test.ts      Object.<anonymous>
        /src/stores/Discussions/discussion.store.test.ts:180

      at Object.transportFormatted (node_modules/tslog/dist/cjs/runtime/nodejs/index.js:116:13)

    console.log
      2024-05-11 19:28:39.598   ERROR           Comment not editable by user {
        user: {
          _id: '77299fbb-f905-4edd-979e-82e4ccfc6a11',
          _created: 'Wed Sep 06 2023 13:24:20 GMT+0000 (Coordinated Universal Time)',
          _modified: 'Thu Jun 29 2023 11:22:48 GMT+0000 (Coordinated Universal Time)',
          _deleted: true,
          _contentModifiedTimestamp: 'Sun Apr 07 2024 06:45:55 GMT+0000 (Coordinated Universal Time)',
          _authID: 'cbb07e06-b7cd-4b91-b865-526dd901ee42',
          profileType: 'member',
          userName: 'Leora35',
          displayName: 'Jacqueline Swaniawski',
          verified: false,
          links: [],
          moderation: 'accepted',
          country: 'MH',
          notifications: [],
          coverImages: []
        }
      }

      at Object.transportFormatted (node_modules/tslog/dist/cjs/runtime/nodejs/index.js:116:13)

    console.log
      2024-05-11 19:28:39.599   ERROR
       Error  Comment not editable by user
      error stack:
        • discussions.store.tsx DiscussionStore.editComment
        /src/stores/Discussions/discussions.store.tsx:140
        • discussion.store.test.ts      Object.<anonymous>
        /src/stores/Discussions/discussion.store.test.ts:277

      at Object.transportFormatted (node_modules/tslog/dist/cjs/runtime/nodejs/index.js:116:13)

    console.log
      2024-05-11 19:28:39.604   ERROR           Comment can not be deleted by user {
        user: {
          _id: 'b8cc47a9-03fc-4a4b-966f-0dc2f18b3596',
          _created: 'Sun Aug 13 2023 09:06:26 GMT+0000 (Coordinated Universal Time)',
          _modified: 'Mon Dec 04 2023 10:54:19 GMT+0000 (Coordinated Universal Time)',
          _deleted: false,
          _contentModifiedTimestamp: 'Wed Jan 17 2024 03:33:09 GMT+0000 (Coordinated Universal Time)',
          _authID: '2c9f1c95-5376-475f-8242-474159b35703',
          profileType: 'community-builder',
          userName: 'Natalia_Beier18',
          displayName: 'Mable Kunde',
          verified: true,
          links: [],
          moderation: 'awaiting-moderation',
          country: 'IL',
          notifications: [],
          coverImages: []
        }
      }

      at Object.transportFormatted (node_modules/tslog/dist/cjs/runtime/nodejs/index.js:116:13)

    console.log
      2024-05-11 19:28:39.605   ERROR
       Error  Comment not editable by user
      error stack:
        • discussions.store.tsx DiscussionStore.deleteComment
        /src/stores/Discussions/discussions.store.tsx:181
        • discussion.store.test.ts      Object.<anonymous>
        /src/stores/Discussions/discussion.store.test.ts:343

      at Object.transportFormatted (node_modules/tslog/dist/cjs/runtime/nodejs/index.js:116:13)

PASS src/pages/UserSettings/UserSettings.test.tsx (7.799 s, 1207 MB heap size)

source: https://app.circleci.com/pipelines/github/ONEARMY/community-platform/8929/workflows/085f354f-3bcc-4550-baab-ece8e5aea6f6/jobs/77794/parallel-runs/0/steps/0-104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New / Under Discussion
Development

No branches or pull requests

1 participant