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

Add notifications for error status codes #101

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from

Conversation

martin-e91
Copy link
Contributor

@martin-e91 martin-e91 commented Jul 29, 2021

Description

This PR implements the in-app notifications triggered when the server responds with an error status code (between 300 and 600).
This also adds the notification settings tab in the Preferences allowing the user to enable/disable the notifications.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Tested sending requests to the server through Postman.

Configuration:
OS and Version: macOS 11.5
App Version: 0.1.0

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots

Registrazione.schermo.2021-07-29.alle.15.47.51.mov

@martin-e91 martin-e91 added feature Feature pull request and removed enhancement Improvement request labels Jul 29, 2021
@martin-e91 martin-e91 linked an issue Jul 29, 2021 that may be closed by this pull request
martin-e91 and others added 13 commits July 29, 2021 16:52
…tions/mocka into feature/notification-upon-error

# Conflicts:
#	Sources/App/Logic/Notification+Logic.swift
#	Sources/Server/NetworkExchangeMiddleware.swift
…tions/mocka into feature/notification-upon-error
…tions/mocka into feature/notification-upon-error

# Conflicts:
#	Tests/AppTests/Notifications+Tests.swift
@martin-e91 martin-e91 changed the base branch from main to develop August 5, 2021 13:00
@FabrizioBrancati FabrizioBrancati added this to the Mocka 0.2.0 milestone Aug 27, 2021
let httpMethod = HTTPMethod(rawValue: request.method.rawValue)!
let receivedRequestTimeStamp = Date().timeIntervalSince1970

.on($0.method.vaporMethod, $0.vaporParameter) { request -> EventLoopFuture<ClientResponse> in
Copy link

Choose a reason for hiding this comment

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

Suggested change
.on($0.method.vaporMethod, $0.vaporParameter) { request -> EventLoopFuture<ClientResponse> in
.on($0.method.vaporMethod, $0.vaporParameter) { [weak self] request -> EventLoopFuture<ClientResponse> in

Is it possible that the request has a strong reference?

Copy link

@verebes1 verebes1 left a comment

Choose a reason for hiding this comment

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

Great addition to Mocka

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

Successfully merging this pull request may close these issues.

Add Local Notifications
3 participants