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

fix: ensure that feedback and response interactions return correct mutation content and trigger subscriptions #4309

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

sjschlapbach
Copy link
Member

@sjschlapbach sjschlapbach commented Oct 16, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced feedback handling in the Audience Interaction component for improved user experience.
    • Immediate UI updates upon feedback deletion for a more responsive interface.
    • Added detailed fields in feedback response for better insights.
    • New test cases for live quiz workflows and feedback management functionalities.
  • Bug Fixes

    • Improved state management for feedback responses to ensure accurate display.
  • Documentation

    • Comments added for future refactoring related to live quiz setup.

Copy link

aviator-app bot commented Oct 16, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Copy link

coderabbitai bot commented Oct 16, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces several updates primarily focused on enhancing feedback handling within the AudienceInteraction component. Key changes include the addition of new GraphQL imports, modifications to the updateQuery and feedback deletion methods, and updates to the DeleteFeedbackResponse mutation to include more detailed response fields. Additionally, the Cockpit component has been streamlined by removing unused imports, while GraphQL schema definitions have been updated to support new data structures. Overall, the changes improve the management of feedback and session data within the application.

Changes

File Change Summary
apps/frontend-manage/src/components/interaction/AudienceInteraction.tsx Updated feedback handling, added GraphQL imports, modified updateQuery and feedback deletion methods to include optimistic responses and cache updates.
apps/frontend-manage/src/pages/sessions/[id]/cockpit.tsx Removed unused useTranslations import, added comments for future refactoring related to live quiz setup, and ensured the component maintains loading/error handling.
packages/graphql/src/graphql/ops/MDeleteFeedbackResponse.graphql Enhanced DeleteFeedbackResponse mutation with additional response fields such as isPublished, isPinned, and resolvedAt.
packages/graphql/src/ops.ts Updated GraphQL schema definitions with new types, fields, and enumerations.
packages/graphql/src/public/client.json Updated hash value for DeleteFeedbackResponse key, indicating data changes.
packages/graphql/src/public/server.json Modified GraphQL mutations and queries to include new fields and parameters, enhancing data retrieval capabilities.
packages/graphql/src/services/feedbacks.ts Enhanced deleteFeedbackResponse function to ensure correct state publication after deletion.
cypress/cypress/e2e/F-live-quiz-workflow.cy.ts Enhanced Cypress tests for live quiz workflows, adding new test cases and refining cleanup processes.

Possibly related PRs

Suggested reviewers

  • rschlaefli

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

cypress bot commented Oct 16, 2024

klicker-uzh    Run #3227

Run Properties:  status check passed Passed #3227  •  git commit 70024dd9cd ℹ️: Merge d86d8fae710d3ced8a2ba5e401bbf9253dc27bf1 into 2d89794fcb73125f1fd36df0cf56...
Project klicker-uzh
Run status status check passed Passed #3227
Run duration 11m 35s
Commit git commit 70024dd9cd ℹ️: Merge d86d8fae710d3ced8a2ba5e401bbf9253dc27bf1 into 2d89794fcb73125f1fd36df0cf56...
Committer Julius Schlapbach
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 138

Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
cypress/cypress/e2e/F-live-quiz-workflow.cy.ts (5)

31-43: Consider adding assertions to verify question creation

In the test Create the questions required in the live quiz test workflows, you create questions but do not include assertions to confirm that they were created successfully. Adding assertions can help ensure that the questions exist in the system as expected and improve test reliability.


Line range hint 604-604: Address the TODO: Replace with cy.createStacks function

There's a TODO comment indicating that this section should be replaced with the cy.createStacks function after migrating to element stacks. Consider implementing this change to keep the test code up-to-date and reduce technical debt.

Do you want assistance in updating this code with cy.createStacks, or should I open a new GitHub issue to track this task?


Line range hint 582-611: Refactor repeated test steps into reusable functions

The steps for creating and starting a live quiz are repeated in multiple tests. Extracting these steps into reusable functions or custom Cypress commands can reduce code duplication and improve maintainability.


Line range hint 675-685: Reset viewport after mobile device tests

After testing functionalities on mobile devices in Test the live quiz functionalities on mobile devices, consider resetting the viewport to the default to prevent side effects on subsequent tests.

Apply this change at the end of the test to reset the viewport:

...
+ // Reset viewport to default
+ cy.viewport('macbook-15')

Line range hint 694-700: Replace fixed waits with dynamic waits

Using fixed delays like cy.wait(500) can lead to flaky tests. Instead, use dynamic waits by asserting the presence or state of elements before proceeding.

Apply this diff to replace cy.wait() with dynamic waits:

- cy.wait(1000)
+ cy.get('[data-cy="next-block-timeline"]').should('be.visible')

- cy.get('[data-cy="next-block-timeline"]').click()
- cy.wait(500)
+ cy.get('[data-cy="next-block-timeline"]').click()
+ cy.get('[data-cy="some-selector-after-click"]').should('be.visible')

- cy.get('[data-cy="next-block-timeline"]').click()
- cy.wait(500)
+ cy.get('[data-cy="next-block-timeline"]').click()
+ cy.get('[data-cy="another-selector-after-click"]').should('be.visible')
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8817f2b and d86d8fa.

📒 Files selected for processing (1)
  • cypress/cypress/e2e/F-live-quiz-workflow.cy.ts (7 hunks)
🧰 Additional context used

@sjschlapbach sjschlapbach merged commit 140cabd into v3 Oct 16, 2024
12 of 14 checks passed
@sjschlapbach sjschlapbach deleted the fix-subscriptions-mutations-live-quiz branch October 16, 2024 20:26
Copy link

cypress bot commented Oct 16, 2024

klicker-uzh    Run #3228

Run Properties:  status check passed Passed #3228  •  git commit 140cabd163: fix: ensure that feedback and response interactions return correct mutation cont...
Project klicker-uzh
Run status status check passed Passed #3228
Run duration 12m 28s
Commit git commit 140cabd163: fix: ensure that feedback and response interactions return correct mutation cont...
Committer Julius Schlapbach
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant