Customer App: Restaurant Review Update & Limit

Alex Johnson
-
Customer App: Restaurant Review Update & Limit

Bug Report: Restaurant Review Issues on Discovery Screen

This document details a bug encountered within the customer application related to restaurant reviews. Specifically, the review displayed on the restaurant's discovery screen doesn't update immediately after a customer submits a review. Furthermore, the application currently allows customers to submit multiple reviews for the same order, which is not the intended behavior.

Describe the Bug

Restaurant review updates are not reflected on the discovery screen immediately after a customer submits a review. This means that when a customer provides feedback for a restaurant through their past orders, the updated review score or comments don't appear on the main restaurant listing in the discovery section until the user navigates to the restaurant's detail page. This inconsistent behavior can lead to a misleading user experience, as customers may not see the most current reviews at a glance.

Another significant issue is the lack of restriction on multiple reviews. Ideally, a customer should only be able to review an order once. However, the current implementation allows customers to repeatedly submit reviews for the same order, which can skew the restaurant's overall rating and provide an inaccurate representation of customer satisfaction. This can potentially impact the restaurant's reputation and influence other customers' decisions.

Steps to Reproduce

To replicate these issues, follow these steps:

  1. Navigate to the Customer Application: Launch the customer application on your device.
  2. Access the Profile Menu: Tap on the profile menu button, usually located in the bottom navigation bar.
  3. Go to Order History: Under the "My Orders" section, select "Order History" to view your past orders.
  4. Select a Past Order: Choose any completed order from the "Past" tab.
  5. Submit a Review: Rate the order and leave a review comment, then submit it.
  6. Return to the Discovery Page: Go back to the main discovery page where restaurants are listed.
  7. Observe the Restaurant's Review: Check the restaurant you just reviewed. You'll notice that the review score or comments haven't been updated.
  8. Verify Multiple Reviews: Repeat steps 4 and 5 multiple times for the same order. Notice that the application allows you to submit multiple reviews for the same order.

Expected Behavior

The expected behavior is as follows:

  • Immediate Review Updates: When a customer submits a review for a restaurant, the updated review score and comments should be displayed immediately on the restaurant's listing on the discovery page. This ensures that customers see the most current and accurate feedback without having to navigate to the restaurant's detail page.
  • Single Review per Order: The application should restrict customers to submitting only one review per order. Once a review has been submitted for an order, the customer should not be able to submit another review for that same order. This ensures that the restaurant's overall rating is based on a fair and accurate representation of customer feedback.

Screen Recording

A screen recording demonstrating the issue is available here: WhatsApp.Video.2025-01-15.at.11.49.12.AM.1.mp4

Smartphone Information

  • Device: Infinix Hot 50
  • OS: Windows (Note: This should likely be Android, as Infinix devices run on Android. Please confirm the correct OS.)
  • Browser: Application
  • Version: 14

Proposed Solutions for Restaurant Review Display and Limitations

Addressing the issues of delayed review updates on the discovery screen and the lack of restrictions on multiple reviews per order requires a multi-faceted approach. These solutions focus on enhancing the user experience by providing real-time feedback and ensuring the integrity of the review system. Let's explore some proposed solutions in detail.

Immediate Review Updates on Discovery Screen

To ensure that review updates are displayed immediately on the restaurant discovery screen, several strategies can be implemented. The primary goal is to minimize latency and ensure that the front-end reflects the most recent data available.

  • Real-time Updates with WebSockets: Implement WebSockets to provide real-time updates between the server and the client. When a customer submits a review, the server can push the updated review data to all connected clients, ensuring that the discovery screen is updated instantly. This approach reduces the need for frequent polling and provides a seamless user experience. WebSockets allow for bidirectional communication, making it efficient for handling real-time data updates. Ensure that the WebSocket implementation is optimized for scalability and reliability, especially during peak usage times.
  • Optimized Caching Strategies: Utilize caching mechanisms to store review data and update it efficiently. Implement a cache invalidation strategy that triggers an update whenever a new review is submitted. For example, you can use a Redis cache to store aggregated review data for each restaurant. When a new review is submitted, invalidate the cache for that restaurant, forcing the system to recalculate and update the cached data. This approach reduces the load on the database and ensures that the discovery screen displays the most up-to-date information without significant delays. Regularly monitor cache performance to ensure optimal efficiency.
  • Background Processing Queues: Employ background processing queues to handle review processing asynchronously. When a customer submits a review, add it to a queue (e.g., using Celery or RabbitMQ). A background worker can then process the review, update the database, and refresh the cache. This approach prevents the review submission process from blocking the main application thread, ensuring a smooth user experience. Additionally, background queues can handle a large volume of reviews efficiently, even during peak times. Implement monitoring and error handling to ensure that reviews are processed reliably.

Enforcing Single Review per Order

To prevent customers from submitting multiple reviews for the same order, robust validation and restriction mechanisms must be implemented on both the front-end and back-end.

  • Database Constraints: Implement database constraints to ensure that each customer can only submit one review per order. Add a unique constraint to the reviews table that combines the customer ID and order ID. This prevents duplicate entries and enforces the one-review-per-order rule at the database level. Database constraints provide a reliable and consistent way to enforce data integrity. Ensure that the database schema is properly indexed to optimize query performance.
  • Front-end Disabling: On the front-end, disable the review submission button after a customer has submitted a review for a particular order. Once a review is submitted, the button should be grayed out or hidden, preventing the customer from clicking it again. This provides immediate visual feedback to the user and prevents accidental multiple submissions. Use local storage or session storage to track whether a review has been submitted for an order. Implement appropriate error handling to handle cases where the front-end state is out of sync with the back-end.
  • Back-end Validation: Implement back-end validation to verify that a customer has not already submitted a review for the order before processing a new review submission. Check the database for an existing review with the same customer ID and order ID. If a review already exists, reject the new submission and return an error message to the client. This provides an additional layer of security and ensures that the one-review-per-order rule is enforced even if the front-end is bypassed. Implement detailed logging to track review submissions and identify any potential issues or malicious activity.

Additional Considerations

  • User Interface Feedback: Provide clear and immediate feedback to the user when a review is successfully submitted. Display a confirmation message or update the order status to indicate that a review has been submitted. This enhances the user experience and ensures that customers are aware of the status of their review.
  • Error Handling: Implement robust error handling to gracefully handle any issues that may arise during the review submission process. Display informative error messages to the user and log errors for debugging purposes. This ensures that the application is resilient to unexpected errors and provides a smooth user experience.
  • Performance Monitoring: Continuously monitor the performance of the review submission and display systems. Use performance monitoring tools to identify bottlenecks and optimize performance. This ensures that the application remains responsive and efficient, even during peak usage times.

By implementing these proposed solutions, the customer application can provide a more seamless and accurate experience for users submitting and viewing restaurant reviews. This will enhance user satisfaction and ensure the integrity of the review system.

By addressing these issues, the customer application can provide a more seamless and accurate experience for users submitting and viewing restaurant reviews. This will enhance user satisfaction and ensure the integrity of the review system.

Learn more about best practices for mobile app development

You may also like