Good Work!

Hello Sergi, I am a Software Engineer focused on iOS in general.
I recently started making use of Golang for my private projects because of several reasons. I am mostly focused on modularisation and testability and due to the unknown of my project regarding database selection and what kind of API it will evolve to (REST / gRPC) or what DB (mongo, sql or maybe even GraphQL) I made some research on Hexagonal Architecture and seemed a very organised way of structuring code together with Golang.
due to the tag hexagonalAr I was able to find your repo and saw that you are a very experienced Golang Developer it is kind of educative for me to have a reference who didn't do much backend so thanks for that.
so my question is about your authentication layer I was thinking of the authentication also as a core layer and expose it to the application layer through the AppPort to the driving adapters. I also couldn't see how you generate the tokens would be nice if you can guide me on this path :)
Kind Regards.
Onur

Hi Onur,
thanks for your comment.
I didn't add the authentication to the core layer as, in my humble opinion, this is not part of the business of the app (which in this case is managing users). So it's the API responsability to decide if a call it's authorized to be performed or not. The approach that I followed was adding a middleware to the endpoints that I want to be protected, so I easily reuse the same code.
Regarding the second question, the tokens are generating during the login, (see this function please: https://github.com/sergicanet9/go-hexagonal-api/blob/e9b3787508752291e05f38ba1bf82b76b5e02c53/core/services/user.go#L211). Tokens not only allow users to be authenticated, but also includes the claims of the user so that we can also control authorization (for example, delete requests can only be performed but users with claim "admin").
I hope that my answers are helpful for you.
Best regards,
Sergi
[https://opengraph.githubassets.com/f00c5d6ecb9ae909bb4295ead77211f7985822b0e088ef0fe5db517e11a7f251/sergicanet9/go-hexagonal-api]https://github.com/sergicanet9/go-hexagonal-api/blob/e9b3787508752291e05f38ba1bf82b76b5e02c53/core/services/user.go#L211
go-hexagonal-api/user.go at e9b3787508752291e05f38ba1bf82b76b5e02c53 · sergicanet9/go-hexagonal-apihttps://github.com/sergicanet9/go-hexagonal-api/blob/e9b3787508752291e05f38ba1bf82b76b5e02c53/core/services/user.go#L211
REST API implementing Hexagonal Architecture (Ports & Adapters) making use of own scv-go-tools package. - go-hexagonal-api/user.go at e9b3787508752291e05f38ba1bf82b76b5e02c53 · sergicanet9/go-h...
github.com

De: Onur Hüseyin Çantay @.>
Enviado: lunes, 8 de agosto de 2022 12:20
Para: sergicanet9/go-hexagonal-api @.>
Cc: Subscribed @.***>
Asunto: [sergicanet9/go-hexagonal-api] Good Work! (Issue #1)
Hello Sergi, I am a Software Engineer focused on iOS in general.
I recently started making use of Golang for my private projects because of several reasons. I am mostly focused on modularisation and testability and due to the unknown of my project regarding database selection and what kind of API it will evolve to (REST / gRPC) or what DB (mongo, sql or maybe even GraphQL) I made some research on Hexagonal Architecture and seemed a very organised way of structuring code together with Golang.
due to the tag hexagonalArhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftopics%2Fhexagonal-architecture&data=05|01||0d2d089713254c7c68a908da79279051|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637955508072062185|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=gyD2M3mjfJiOoS7%2Fa5qVLPyaRXmjZPgICwpP%2F6MteK8%3D&reserved=0 I was able to find your repo and saw that you are a very experienced Golang Developer it is kind of educative for me to have a reference who didn't do much backend so thanks for that.
so my question is about your authentication layer I was thinking of the authentication also as a core layer and expose it to the application layer through the AppPort to the driving adapters. I also couldn't see how you generate the tokens would be nice if you can guide me on this path :)
Kind Regards.
Onur
—
Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsergicanet9%2Fgo-hexagonal-api%2Fissues%2F1&data=05|01||0d2d089713254c7c68a908da79279051|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637955508072062185|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=Ih3kTJPNNrSr6KgiR2CFW7fjuD6GJ0PMMvvie1rpdzI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGH6L7QJH2G5UVLZ3VB6KCDVYDNNLANCNFSM554SI5ZQ&data=05|01||0d2d089713254c7c68a908da79279051|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637955508072218420|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=CwgRWrH35PqzET8Nq0SyclC2ehXKr%2BcUMoBwzcfsLXU%3D&reserved=0.
You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hi Sergi,
thanks for the explanation, after some thinking I decided also that its not part of the core logic of the application.
But I do believe it should be replaceable at any time for example today we are making use of token based auth and in the future we want to change it how should we proceed for that scenario do you still think it shouldn't be like a seperate adapter ?
Kind Regards.

Hi Onur,
In that case would be enough to change the JWT middleware that I created in the scv-go-tools repo by another one.
As it is simply a middleware that is added when declaring the routes I don’t see the point of creating a port for that + an adapter, because it will add more complexity and could not longer be used as a middleware, but of course this could be implemented in another way.
Best,
Sergi Canet
On 10 Aug 2022, at 19:50, Onur Hüseyin Çantay @.***> wrote:

Hi Sergi,
thanks for the explanation, after some thinking I decided also that its not part of the core logic of the application.
But I do believe it should be replaceable at any time for example today we are making use of token based auth and in the future we want to change it how should we proceed for that scenario do you still think it shouldn't be like a seperate adapter ?
Kind Regards.
—
Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsergicanet9%2Fgo-hexagonal-api%2Fissues%2F1%23issuecomment-1211050980&data=05|01||da1e002d6340430eced708da7af8c246|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637957506079913888|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=OnBm%2Bx8yXt1J6itWir7Dq7nMphb%2FiotfiLtybh2wFkI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGH6L7VHDBW2CEL2AI6RIU3VYPTU3ANCNFSM554SI5ZQ&data=05|01||da1e002d6340430eced708da7af8c246|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637957506079913888|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=w5bRA4EmKzXAL6JXGRmmhc%2BKnjKuxL5oTyE2CNUmcC4%3D&reserved=0.
You are receiving this because you commented.Message ID: @.***>

Thanks for the clarifications sergi have a nice day.


v0.7.0 cargo build fails

Hello! I'm trying to run lychee locally on the Ubuntu WSL (which, unfortunately, rules out docker).
I ran cargo install lychee and got the following compiler error:
   Compiling lychee v0.7.0
error[E0658]: binding by-move and by-ref in the same pattern is unstable
  --> /home/redacted/.cargo/registry/src/github.com-1ecc6299db9ec823/lychee-0.7.0/src/stats.rs:44:22
   |
44 |         let Response(source, ResponseBody { ref status, .. }) = response;
   |                      ^^^^^^                 ---------- by-ref pattern here
   |                      |
   |                      by-move pattern here
   |
   = note: see issue #68354 <https://github.com/rust-lang/rust/issues/68354> for more information

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: failed to compile `lychee v0.7.0`, intermediate artifacts can be found at `/tmp/cargo-install2Vt0p0`

Caused by:
  could not compile `lychee`.

Any ideas?  Thanks! 😄

update your rustc

Nvm - I just wanted the binary, which I have since downloaded and successfully been using. Thanks 😄


Try and fix wrapping in syntax migration guide

Full screen on my laptop it looks fine. But not full screen it looks bad:


Runtime error when adding an APIView to SDK meeting

Error reports Patch function can't be applied. Value needs to be between 0 and 100.

I checked and it looks that the problem is in the name column as we are creating the name from the combination of <Service name> - <domain Id> - API View - <date>. If the service name is too long (there are some that are clsoe to 70 characters :| ) then the whole string exceeds the max of the column of 100.
I went and changed the Artifact.Name value to 500 and published the table.
Does this need to happen on the other environments?


failure due to Utp endpoint InvalidPacket

Env: 12 droplets (including 6 hard coded endpoints) and 1 droplet running the safe_client self_authentication example - receiving the warning below:
safe@SAFE-ROUTING-9:~/safe_client/target/release/examples$ RUST_LOG=debug ./self_authentication

Do you already have an account created (enter Y for yes) ?
Y

	Manual Account Login
	====================

------------ Enter Keyword ---------------
Fraser

------------ Enter Password --------------
tictac

--------- Enter PIN (4 Digits) -----------
0999

Trying to log in ...
WARN:crust::transport: NOTE: Transport connect <IP_ADDRESS>:5483 failure due to Utp endpoint InvalidPacket
WARN:crust::transport: NOTE: Transport connect <IP_ADDRESS>:5483 failure due to Utp endpoint InvalidPacket
WARN:crust::transport: NOTE: Transport connect <IP_ADDRESS>:5483 failure due to Utp endpoint InvalidPacket
WARN:crust::transport: NOTE: Transport connect <IP_ADDRESS>:5483 failure due to Utp endpoint InvalidPacket
WARN:crust::transport: NOTE: Transport connect <IP_ADDRESS>:5483 failure due to Utp endpoint InvalidPacket
WARN:crust::transport: NOTE: Transport connect <IP_ADDRESS>:5483 failure due to Utp endpoint InvalidPacket

Hi @rossmuir , crust suffered a lot of internal changes since this bug was issued. I tried to reproduce it (using less nodes than you), but I haven't see any warning related to InvalidPacket and Utp. Could you check if this bug is still happening?

Sure I can retest - thanks

A theory: Beacon used UDP and the same port as uTP, then InvalidPackets were read.
Beacon is using a different port now: https://github.com/maidsafe/crust/commit/7b3c9cf2ca9caeea8a733cc3b74153c883f9f78b#diff-0fb07a438eb34eab8647cbaa5b5a7482R41

A theory: Beacon used UDP and the same port as uTP, then InvalidPackets were read.
Beacon is using a different port now: https://github.com/maidsafe/crust/commit/7b3c9cf2ca9caeea8a733cc3b74153c883f9f78b#diff-0fb07a438eb34eab8647cbaa5b5a7482R41

Closing the issue as I cannot reproduce it.


chore: mark version v3.0.5

LGTM but let's bump the minor version, i.e. make this v3.1.0, given the Chromium roll.


Feature/ios8

This change is

Reviewed 113 of 113 files at r1.
Review status: all files reviewed at latest revision, 28 unresolved discussions.

byuSuite/Apps/Calendars/CalendarEventDetailViewController.m, line 92 at r1 (raw file):

//                        [alertView show];
//                    });
					//TODO: Test that this works the same

To take a page out of your book... have you done this? :P

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 95 at r1 (raw file):

    [self dismissViewControllerAnimated:YES completion:nil];
    [self.cougarCash resetCougarCashDelegate];
	[ViewUtils createSimplePopupFromController:self withTitle:@"Error Processing Payment" message:@"The server encountered an error. Please try again later" andCallback:nil];

Differing error message.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 109 at r1 (raw file):

- (void) transactionsFailed
{
	[ViewUtils createSimplePopupFromController:self withTitle:@"Error" message:@"The server encountered an error. Please try again later." andCallback:^(UIAlertAction *action) {

Differing error message.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 125 at r1 (raw file):

- (void) balanceFailed
{
	[ViewUtils createSimplePopupFromController:self withTitle:@"Error" message:@"The server encountered an error. Please try again later." andCallback:^(UIAlertAction *action) {

Differing error message.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 351 at r1 (raw file):

- (void) reportCardLostSucceeded
{
	[ViewUtils createSimplePopupFromController:self withTitle:@"Request Successful" message:@"Your card has now been marked as lost. We hope it is found soon!" andCallback:nil];

Differing error message.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 357 at r1 (raw file):

- (void) reportCardLostFailed
{
	[ViewUtils createSimplePopupFromController:self withTitle:@"Error" message:@"There was an error while reporting your card as lost. Please try again later." andCallback:nil];

Differing error message.

byuSuite/Apps/CougarCash/CougarCashPaymentAmountViewController.m, line 227 at r1 (raw file):

    self.firstIncrementButton = [[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:@"$%@", buttonTitlesArray[0]]
                                                                 style:UIBarButtonItemStyleBordered

Were these changes from Bordered to Plain intentional?

byuSuite/Apps/Dining Account/DiningAccountViewController.m, line 71 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Dining Account/DiningAccountViewController.m#L71)):

	NSLog(@"%@", errorMessage);

	[ViewUtils createSimplePopupFromController:self withTitle:@"Error" message:@"Could not retrieve account info." andCallback:^(UIAlertAction *action) {

Differing error message.

byuSuite/Apps/Lab Computers/LabComputersDetailViewController.m, line 34 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Lab Computers/LabComputersDetailViewController.m#L34)):

-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
	[ViewUtils createSimplePopupFromController:self withTitle:@"Unable to Load Data" message:nil andCallback:^(UIAlertAction *action) {

Differing error message.

byuSuite/Apps/LearningSuite/LearningSuiteAggregateCalendarViewController.m, line 249 at r1 (raw file):

        [self.spinner stopAnimating];
        [self createAssignmentsFailed:nil];
		[ViewUtils createSimplePopupFromController:self withTitle:@"No calendar dat found for this course." message:nil andCallback:nil];

This one is differently a mistake. dat is not a word :P so I'm sure this was a mistake.

byuSuite/Apps/LearningSuite/LearningSuiteAssignmentsViewController.m, line 131 at r1 (raw file):

    if (lsAssignments.allAssignments.count == 0)
    {
		[ViewUtils createSimplePopupFromController:self withTitle:@"No assignments found for this course." message:nil andCallback:nil];

Differing error message.

byuSuite/Apps/LearningSuite/LearningSuiteAssignmentsViewController.m, line 151 at r1 (raw file):

    if (lsAssignments.allAssignments.count == 0)
    {
		[ViewUtils createSimplePopupFromController:self withTitle:@"No assignments found for this course." message:nil andCallback:nil];

Differing error message.

byuSuite/Apps/LearningSuite/LearningSuitePageViewController.m, line 12 at r1 (raw file):

#import "LSPageContents.h"
#import "LSPageContentItem.h"
//#import <CommonCrypto/CommonDigest.h>

Intentionally removed?

byuSuite/Apps/LearningSuite/LearningSuiteRootViewController.m, line 219 at r1 (raw file):

    {
        if ((self.instructedCourses.courses.count + self.courses.courses.count) == 0){
			[ViewUtils createSimplePopupFromController:self withTitle:@"No published Learning Suite courses found for the current semester." message:nil andCallback:^(UIAlertAction *action) {

Did you mean to move the message to the title and not have a message?

byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m, line 203 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m#L203)):

			self.table.alpha = 1;
		}];
	}];

Was this addition intentional?

byuSuite/Apps/ManageDevices/ManageDevicesViewController.m, line 49 at r1 (raw file):

{
    [self.spinner stopAnimating];
	[ViewUtils createSimplePopupFromController:self withTitle:nil message:@"Error loading device." andCallback:^(UIAlertAction *action) {

Differing error message.

byuSuite/Apps/MapMyClasses/controller/MapMyClassesViewController.m, line 19 at r1 (raw file):

#import "ViewUtils.h"

#define CLASS_DESCRIPTIONS_ALERT_VIEW_TAG 1

Did you mean to remove this #define

byuSuite/Apps/MapMyFinals/controller/MapMyFinalsViewController.m, line 17 at r1 (raw file):

#import "ViewUtils.h"

#define FINALS_ALERT_VIEW_TAG 1

Did you mean to remove this #define

byuSuite/Apps/MyNextClass/controller/MyNextClassViewController.m, line 20 at r1 (raw file):

#define HIDE_DETAIL_DISCLOSURE_BUTTON YES
#define NO_CLASSES_ERROR_TITLE @"No Classes Found in Current Semester"
#define SCHEDULE_ALERT_VIEW_TAG 1

Did you mean to remove this #define?

byuSuite/Apps/MyNextClass/controller/MyNextClassViewController.m, line 350 at r1 (raw file):

    NSDate *tempDate = [df dateFromString:[NSString stringWithFormat:@"%@", startTimeString]];

    NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];

Did you intentionally rearrange all these things?

byuSuite/Apps/TestingCenter/model/TestingCenterUtils.m, line 36 at r1 (raw file):

+(NSDate *)stripTimeFromDate:(NSDate *)date {
	// Specify which units we would like to use
	unsigned units = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;

Did you mean to rearrange these?

byuSuite/Apps/YTime/controller/YTimeRootViewController.m, line 15 at r1 (raw file):

#import <CoreLocation/CoreLocation.h>

#define LOCATION_SETTINGS_TAG 1

Did you mean to remove these #defines?

byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.h, line 52 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.h#L52)):

-(void)thisDeviceSubmitRequest;
-(void)otherDeviceSubmitRequest;
-(void)deviceViewTermsRequest;

Did you mean to remove this?

byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m, line 125 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m#L125)):

    }
    //NSLog(@"Leaving thisDeviceSubmitRequest");
}

Did you mean to remove all of this?

byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m, line 377 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m#L377)):

        }
    }
}

And all of this?

byuSuite/Classes/Basic Data Access/LearningSuite/Calendar/LSCalendarAggregate.m, line 67 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/LearningSuite/Calendar/LSCalendarAggregate.m#L67)):

    for (NSDictionary *dictionary in self.data) {
        LSCalendarItem *item = [LSCalendarItem calendarItemFromDictionary:dictionary];
        NSDateComponents *dayMonthYear = [calendar components:NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit fromDate:item.endDate];

Did you mean to rearrange these?

byuSuite/Classes/Basic Data Access/Network Availability/NetworkAvailability.m, line 15 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Classes/Basic Data Access/Network Availability/NetworkAvailability.m#L15)):

+(BOOL)checkInternetAvailability {
	return [[Reachability reachabilityForInternetConnection] currentReachabilityStatus] != NotReachable;

Message removed?

byuSuite/Classes/ReusableUI/ViewUtils.m, line 13 at r1 (raw file):

@implementation ViewUtils

//This function originally was created to handle compatibility with iOS 7 devices using UIAlertView. We decided to keep it in case another version of alerts comes out again

Looks intentional to me...

Comments from Reviewable

Review status: all files reviewed at latest revision, 28 unresolved discussions.

byuSuite/Apps/Calendars/CalendarEventDetailViewController.m, line 92 at r1 (raw file):
Previously, ecbrady wrote…
> To take a page out of your book... have you done this? :P

Haha- yes! I actually just did 10 minutes ago

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 95 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 109 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 125 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 351 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 357 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/CougarCash/CougarCashPaymentAmountViewController.m, line 227 at r1 (raw file):
Previously, ecbrady wrote…
> Were these changes from Bordered to Plain intentional?

Yup. Bordered got deprecated :p

byuSuite/Apps/Dining Account/DiningAccountViewController.m, line 71 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Dining Account/DiningAccountViewController.m#L71)):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/Lab Computers/LabComputersDetailViewController.m, line 34 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Lab Computers/LabComputersDetailViewController.m#L34)):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/LearningSuite/LearningSuiteAggregateCalendarViewController.m, line 249 at r1 (raw file):
Previously, ecbrady wrote…
> This one is differently a mistake. dat is not a word :P so I'm sure this was a mistake.

Done.

byuSuite/Apps/LearningSuite/LearningSuiteAssignmentsViewController.m, line 131 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/LearningSuite/LearningSuiteAssignmentsViewController.m, line 151 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Done.

byuSuite/Apps/LearningSuite/LearningSuitePageViewController.m, line 12 at r1 (raw file):
Previously, ecbrady wrote…
> Intentionally removed?

Done.

byuSuite/Apps/LearningSuite/LearningSuiteRootViewController.m, line 219 at r1 (raw file):
Previously, ecbrady wrote…
> Did you mean to move the message to the title and not have a message?

Done.

byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m, line 203 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m#L203)):
Previously, ecbrady wrote…
> Was this addition intentional?

What do you mean?

byuSuite/Apps/ManageDevices/ManageDevicesViewController.m, line 49 at r1 (raw file):
Previously, ecbrady wrote…
> Differing error message.

Good catch

byuSuite/Apps/MapMyClasses/controller/MapMyClassesViewController.m, line 19 at r1 (raw file):
Previously, ecbrady wrote…
> Did you mean to remove this #define

Done.

byuSuite/Apps/MapMyFinals/controller/MapMyFinalsViewController.m, line 17 at r1 (raw file):
Previously, ecbrady wrote…
> Did you mean to remove this #define

Done.

byuSuite/Apps/MyNextClass/controller/MyNextClassViewController.m, line 20 at r1 (raw file):
Previously, ecbrady wrote…
> Did you mean to remove this #define?

Done.

byuSuite/Apps/MyNextClass/controller/MyNextClassViewController.m, line 350 at r1 (raw file):
Previously, ecbrady wrote…
> Did you intentionally rearrange all these things?

Done.

byuSuite/Apps/TestingCenter/model/TestingCenterUtils.m, line 36 at r1 (raw file):
Previously, ecbrady wrote…
> Did you mean to rearrange these?

Done.

byuSuite/Apps/YTime/controller/YTimeRootViewController.m, line 15 at r1 (raw file):
Previously, ecbrady wrote…
> Did you mean to remove these #defines?

Done.

byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.h, line 52 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.h#L52)):
Previously, ecbrady wrote…
> Did you mean to remove this?

Done.

byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m, line 125 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m#L125)):
Previously, ecbrady wrote…
> Did you mean to remove all of this?

Done.

byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m, line 377 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/ByuNetworkDeviceRegistration/ByuNetworkDeviceRegistration.m#L377)):
Previously, ecbrady wrote…
> And all of this?

Done.

byuSuite/Classes/Basic Data Access/LearningSuite/Calendar/LSCalendarAggregate.m, line 67 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/821505d532c3cccb0ae11a55176c2a4bbc9d5c2a/byuSuite/Classes/Basic Data Access/LearningSuite/Calendar/LSCalendarAggregate.m#L67)):
Previously, ecbrady wrote…
> Did you mean to rearrange these?

Done.

byuSuite/Classes/Basic Data Access/Network Availability/NetworkAvailability.m, line 15 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Classes/Basic Data Access/Network Availability/NetworkAvailability.m#L15)):
Previously, ecbrady wrote…
> Message removed?

Done.

byuSuite/Classes/ReusableUI/ViewUtils.m, line 13 at r1 (raw file):
Previously, ecbrady wrote…
> Looks intentional to me...

Done.

Comments from Reviewable

Review status: all files reviewed at latest revision, 1 unresolved discussion.

byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m, line 203 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m#L203)):
Previously, romrell4 (Eric Romrell) wrote…
> What do you mean?

The addition of the stopAnimating.

Comments from Reviewable

Reviewed 113 of 113 files at r1.
Review status: all files reviewed at latest revision, 5 unresolved discussions.

byuSuite/Apps/Cannon Commons/CannonCommonsOverviewViewController.m, line 152 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Cannon Commons/CannonCommonsOverviewViewController.m#L152)):

        if(!self.hasLaidOutScreen) {
            if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {

interface to statusBar

byuSuite/Apps/ClassRolls/controller/ClassRollsFlashCardViewController.m, line 51 at r1 (raw file):

    if (self.currentIndex == self.instructorClass.students.count) {
        [ViewUtils createSimplePopupFromController:self withTitle:@"Done" message:@"Repeating class again" andCallback:^(UIAlertAction *action) {
            [self initializeFlashCards];

Do we need to -loadCurrentStudent too after initializing flash cards?

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 343 at r1 (raw file):

	UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Card Found" message:@"Would you like to report your card as found?" preferredStyle:UIAlertControllerStyleAlert];
	[controller addAction:[UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
		[self.cougarCash.card reportCardFound];

Before, reportCardFound was only called if someone clicked Yes on the unableToAddFundsAlert. It looks as if it didn't get called when someone clicked Yes for the cardIsAlreadyLostAlert. You've fixed this by calling -reportCardFound in both, but it's a discrepancy so I'm letting you know

byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m, line 203 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m#L203)):
Previously, ecbrady wrote…
> The addition of the stopAnimating.

It's intentional @ecbrady . It used to come right after [alert show]. Now it comes after the popup

byuSuite/Classes/MainScreen/MainScreenFavoritesViewController.m, line 156 at r1 (raw file):

	if (buttonIndex == 1) {
		//If they clicked "OK", launch the external feature that is saved in the FeatureManager as _currentFeature
		[FeatureManager launchCurrentExternalFeature];

Is this functionality remaining somewhere?

Comments from Reviewable

Review status: all files reviewed at latest revision, 5 unresolved discussions.

byuSuite/Apps/Cannon Commons/CannonCommonsOverviewViewController.m, line 152 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Cannon Commons/CannonCommonsOverviewViewController.m#L152)):
Previously, nateyj (Nathan Johnson) wrote…
> interface to statusBar

Done.

byuSuite/Apps/ClassRolls/controller/ClassRollsFlashCardViewController.m, line 51 at r1 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Do we need to -loadCurrentStudent too after initializing flash cards?

I'm not sure I understand what you mean here...

byuSuite/Apps/CougarCash/CougarCashMainViewController.m, line 343 at r1 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Before, reportCardFound was only called if someone clicked Yes on the unableToAddFundsAlert. It looks as if it didn't get called when someone clicked Yes for the cardIsAlreadyLostAlert. You've fixed this by calling -reportCardFound in both, but it's a discrepancy so I'm letting you know

Done.

byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m, line 203 at r1 ([raw file](https://github.com/byu-oit-appdev/ios-byusuite/blob/2f2aa40a208d55545bed18f352f385ff3eab36b1/byuSuite/Apps/Locker Rental/LockerRentalLockerDetailViewController.m#L203)):
Previously, nateyj (Nathan Johnson) wrote…
> It's intentional @ecbrady . It used to come right after [alert show]. Now it comes after the popup

Done.

byuSuite/Classes/MainScreen/MainScreenFavoritesViewController.m, line 156 at r1 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Is this functionality remaining somewhere?

Good catch. Yes it is. :)

Comments from Reviewable

Review status: all files reviewed at latest revision, 2 unresolved discussions.

byuSuite/Apps/ClassRolls/controller/ClassRollsFlashCardViewController.m, line 51 at r1 (raw file):
Previously, romrell4 (Eric Romrell) wrote…
> I'm not sure I understand what you mean here...

Nevermind! -initializeFlashCards calls -loadCurrentStudent

Comments from Reviewable

Reviewed 68 of 68 files at r2, 7 of 8 files at r3, 8 of 8 files at r4.
Review status: 127 of 130 files reviewed at latest revision, 7 unresolved discussions.

byuSuite/Apps/AedLocator/AedLocatorViewController.m, line 196 at r1 (raw file):

    self.closestAed = tempAed;
    self.navigationItem.title = [NSString stringWithFormat:@"%@ %@", self.closestAed.properties.building, self.closestAed.properties.room];
	self.locationLabel.numberOfLines = 0; //This line allows the label to automatically select how many lines it needs to be

Is this set to zero in the storyboard?

byuSuite/Apps/Calendars/CalendarEventDetailViewController.m, line 219 at r2 (raw file):

		[store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
			if (granted){

just needs a space

byuSuite/Apps/LearningSuite/LearningSuiteAggregateCalendarViewController.m, line 281 at r1 (raw file):

    }
    else{
        [BYUAnalytics actionPerformedInCurrentFeature:LEARNINGSUITE_ICAL_CALENDAR_ACTION_CANCELED];

Do we still want to record that the user pressed cancel from the action sheet?

byuSuite/Apps/SickVacation/controller/SickVacationMainViewController.m, line 48 at r2 (raw file):

}

-(void)popUpWithTitle:(NSString *)title andMessage:(NSString *)message {

Do we still need this function if it's empty?

byuSuite/Apps/TestingCenter/controller/TestingCenterScoresViewController.m, line 176 at r1 (raw file):

	//This function will be called whenever the year term is clicked
	UIActionSheet *action = [[UIActionSheet alloc] init];
	action.title = @"Select a Semester";

You sure you don't want the title anymore?

byuSuite/Apps/YTime/controller/YTimeRootViewController.m, line 110 at r2 (raw file):

		NSString *message = [NSString stringWithFormat:@"You are already clocked<EMAIL_ADDRESS>Please confirm that you would like to clock %@ again.", punchIn ? @"in" : @"out", punchIn ? @"in" : @"out"];

		[self showActionSheetFromItem:sender withTitle:message andActions:[UIAlertAction actionWithTitle:@"Confirm" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

Do you want to keep the previous title "Double Punch Warning" at all? Or just use the message as the title?

Comments from Reviewable

Reviewed 3 of 3 files at r5.
Review status: all files reviewed at latest revision, 7 unresolved discussions.

Comments from Reviewable

Review status: 127 of 130 files reviewed at latest revision, 7 unresolved discussions.

byuSuite/Apps/AedLocator/AedLocatorViewController.m, line 196 at r1 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Is this set to zero in the storyboard?

Done.

byuSuite/Apps/Calendars/CalendarEventDetailViewController.m, line 219 at r2 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> just needs a space

Good catch :)

byuSuite/Apps/LearningSuite/LearningSuiteAggregateCalendarViewController.m, line 281 at r1 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Do we still want to record that the user pressed cancel from the action sheet?

Nope

byuSuite/Apps/SickVacation/controller/SickVacationMainViewController.m, line 48 at r2 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Do we still need this function if it's empty?

Absolutely not

byuSuite/Apps/TestingCenter/controller/TestingCenterScoresViewController.m, line 176 at r1 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> You sure you don't want the title anymore?

I definitely do want that

byuSuite/Apps/YTime/controller/YTimeRootViewController.m, line 110 at r2 (raw file):
Previously, nateyj (Nathan Johnson) wrote…
> Do you want to keep the previous title "Double Punch Warning" at all? Or just use the message as the title?

Done.

Comments from Reviewable

Reviewed 3 of 3 files at r6.
Review status: all files reviewed at latest revision, 1 unresolved discussion.

Comments from Reviewable


Basic Linux support with OpenCV and QoL improvements

Hello!
I just found this, and I'm impressed with how good it is. This PR adds: basic Linux support using OpenCV, two new parameters to specify the camera index and capability index, and also fixes the mode switch, which did not work.

Hi! Thank you for considering making a PR to this little thing! Not gonna lie it is VERY basic, you're giving me more credit than I deserve haha. I've checked your additions and I think they look OK, I didn't use openCV as a backend as I saw it more fit to use DS as a way to get the "right" formats, but adding it for linux support is alright. Switches are OK, just I'm not expecting a lot of people to use them.
There are two things you might want to add to the PR if you want to call this linux compatible though.

Not show RTX tracking or quit if chosen when ran on linux.
Make sure requirements.txt is compatible with a linux install. Maybe create a different requirements file. PyGrabber is windows specific I think.
Set up a "Linux Support" section in case installing opencv is non-trivial. I'm not familiar with that install.

Again, thank you for taking your time to add to the repo. I'm unable to test your PR right now as I don't have a linux machine, but I'm getting a new laptop next week so hopefully I will be able to test it then.

I didn't use openCV as a backend as I saw it more fit to use DS as a way to get the "right" formats

Camera support on Linux is what it is and there is no standard way to query camera information and OpenCV might as well just ignore whatever we tell it to do, I already used it for a stream and I did just fine so it should be ok as is.

Not show RTX tracking or quit if chosen when ran on linux.

It should be hidden now.

Make sure requirements.txt is compatible with a linux install. Maybe create a different requirements file. PyGrabber is windows specific I think.

Done, it installs only what it needs on each platform.

Set up a "Linux Support" section in case installing opencv is non-trivial. I'm not familiar with that install.

Nothing specific in this case, the lib includes everything for it to work.

Added a new change that replaces time.time() with time.perf_counter() as the former does not have enough precision and causes random crashes on Linux along with a small change to the semaphore to actually wait for the result and then send the data.

I'm not interested on changing the behavior of the semaphore. Mediapipe ignores frames while processing so it makes sense to keep feeding frames. The change from time.time to time.perf_time seem arbitrary as I'm not sure why you're having the crash. We're talking about potentially a 60fps webcam stream, what precision is needed that qualifies for perf_counter?
Also, please keep changes to a single PR. I need you to either roll back to the agreed changes or the PR will be rejected. We can discuss further changes once I get around testing this one.

Sure, I can back out the semaphore change.
Now, regarding time.time, it is not guaranteed to be more precise than a second and can be affected by the system clock. I experienced multiple crashes because mediapipe expects an increasing timestamp which sometimes did not happen hence the change.
I might add, at least on my systems, mediapipe is faster than the camera, not waiting for the semaphore means the output data will lag, at best, by one camera frame. By waiting we guarantee that it will always send the latest data since we are not waiting for the next camera frame to be read. We can discuss this in more detail in another PR.


Problem with uploading long files using mbedTLS as a server.

Gentlemen, good day to you!
I am facing a problem with uploading long files using mbedTLS as a server.
I am making HTTPS server using mbedTLS (version 2.6.1) over lwIP (version 2.0.3) on STM32F427 MCU device. One of the options is a file upload from any web browser (Google Chrome, Firefox, etc). Size of firmware is in average around 300 KB. So, mbedTLS in my case is working as a server and firmware file is arriving to server in a POST request with HTTP header stating Content-Length around 300 KB. At attempt to read the data using a function mbedtls_ssl_read it gives out an error -0x7200 (-29184), which means MBEDTLS_ERR_SSL_INVALID_RECORD. However in case if I try to upload a firmware with size of several bytes (specially made small just for test) - then everything is working OK, the file is uploaded well and there is no error. So, the error happens only with long files.
I checked various sources and found that perhaps the problem can be solved by enabling the RFC 6066 max_fragment_length extension in the mbedTLS config of the server. Thus I tried to use a function mbedtls_ssl_conf_max_frag_len to solve this problem.
However while playing with it I did not see any result, there is still the same problem.
I have tried to use a functions
mbedtls_ssl_conf_max_frag_len(&sslConfig, MBEDTLS_SSL_MAX_FRAG_LEN_4096)
and
mbedtls_ssl_conf_max_frag_len(&sslConfig, MBEDTLS_SSL_MAX_FRAG_LEN_2048)
Also I have MBEDTLS_SSL_MAX_FRAGMENT_LENGTH defined in mbedtls_config.h.
But seems they give no effect. I am still facing the same error MBEDTLS_ERR_SSL_INVALID_RECORD (-29184 or -0x7200) at attempt to upload a file with big size.
Can anyone support is it possible to upload long files using HTTPS through mbedTLS? How to use function mbedtls_ssl_conf_max_frag_len correctly to make it work?
Thanks, Evgeniy

@EvgeniyVasyliev RFC5246 defined maximal size of the content that can be sent as 16KB:

The length (in bytes) of the following TLSPlaintext.fragment.  The
length MUST NOT exceed 2^14.

It is strange why your client is sending 300 KB of data.
As you can see in https://github.com/ARMmbed/mbedtls/issues/387 and in this post the max_fragment_length  is partially supported, for forming back messages in DTLS.
Nonetheless, you application should be able to receive from the client the encrypted packets in lengths of 16KB, and assemble the image itself.

Thanks, Ron!
Well, I do not have 16 KB free space in my MCU. In case if I had - I would not ask this question... :) I want to process long the requests by chanks. I am able to do it using HTTP (unsecured) by using Socket/Netconn API and reading the request by chanks. Now I want to implement same logic using HTTPS with the help of mbedTLS.
Did you have any experience in working with browsers? Maybe browsers do not support this function of fragmentation (I am using Ajax for file upload)...
Please advise when should I call this function mbedtls_ssl_conf_max_frag_len: after the connection and before the handshake or in some other place?
I see that there is a function ssl_write_real, which takes care of max fragment length and buffer size. Maybe there is also a same function for reading?

@EvgeniyVasyliev I'm sorry, I was under the impression that your server is not running on MCU.
In this case, you should call mbedtls_ssl_conf_max_frag_len with the value you wish. However, the client should support this feature as well. Please verify that the max_fragment_len extension is located in the Client's ClientHello message

Here is SSL_Server function I am using to make all the stuff (read and respond):
void SSL_Server()
{
	int returnValue;
	int httpBufferLength = 0;
	int httpBufferIndex = 0;
	uint8_t sslSessionIsActive = 0;
	struct fs_file *file = NULL;
	size_t tmpCounter = 0;
	size_t httpUploadFileCurrentIndex = 0;
	size_t httpUploadFileEndIndex = 0;
	uint8_t *httpBuffer;

	// Initialize SSL
	mbedtls_net_init(&listenFileDescriptor);
	mbedtls_net_init(&clientFileDescriptor);
	mbedtls_ssl_init(&sslContext);
	mbedtls_ssl_config_init(&sslConfig);
	mbedtls_ssl_cache_init(&sslCache);
	mbedtls_x509_crt_init(&serverCertificate);
	mbedtls_pk_init(&publicKey);
	mbedtls_entropy_init(&entropy);
	mbedtls_ctr_drbg_init(&randomByteGenerator);

	// Load the certificate and private RSA key
	debug_printf("Loading server SSL certificate and key");

	// Use embedded test certificates.
	// Instead, you may want to use mbedtls_x509_crt_parse_file() to read the
	// server and CA certificates, as well as mbedtls_pk_parse_keyfile().
	returnValue = mbedtls_x509_crt_parse(&serverCertificate, (const unsigned char *)mbedtls_test_srv_crt, mbedtls_test_srv_crt_len);
	if (returnValue != 0)
	{
		debug_printf("Operation failed, mbedtls_x509_crt_parse returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	returnValue = mbedtls_x509_crt_parse(&serverCertificate, (const unsigned char *)mbedtls_test_cas_pem, mbedtls_test_cas_pem_len);
	if (returnValue != 0)
	{
		debug_printf("Operation failed, mbedtls_x509_crt_parse returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	returnValue = mbedtls_pk_parse_key(&publicKey, (const unsigned char *)mbedtls_test_srv_key, mbedtls_test_srv_key_len, NULL, 0);
	if (returnValue != 0)
	{
		debug_printf("Operation failed, mbedtls_pk_parse_key returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	// Setup the listening TCP socket
	debug_printf("Binding on https://localhost:%s", PLS_SSL_PORT);

	if ((returnValue = mbedtls_net_bind(&listenFileDescriptor, NULL, PLS_SSL_PORT, MBEDTLS_NET_PROTO_TCP)) != 0)
	{
		debug_printf("Operation failed, mbedtls_net_bind returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	// Seed the random number generator
	debug_printf("Seeding SSL random number generator");

	if ((returnValue = mbedtls_ctr_drbg_seed(&randomByteGenerator, mbedtls_entropy_func, &entropy, (const unsigned char *)personalizationData, strlen((char *)personalizationData))) != 0)
	{
		debug_printf("Operation failed, mbedtls_ctr_drbg_seed returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	// Configure SSL
	debug_printf("Setting up the SSL data");

	if ((returnValue = mbedtls_ssl_config_defaults(&sslConfig, MBEDTLS_SSL_IS_SERVER, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT)) != 0)
	{
		debug_printf("Operation failed, mbedtls_ssl_config_defaults returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	mbedtls_ssl_conf_rng(&sslConfig, mbedtls_ctr_drbg_random, &randomByteGenerator);

	mbedtls_ssl_conf_session_cache(&sslConfig, &sslCache, mbedtls_ssl_cache_get, mbedtls_ssl_cache_set);

	mbedtls_ssl_conf_ca_chain(&sslConfig, serverCertificate.next, NULL);
	if ((returnValue = mbedtls_ssl_conf_own_cert(&sslConfig, &serverCertificate, &publicKey)) != 0)
	{
		debug_printf("Operation failed, mbedtls_ssl_conf_own_cert returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	if ((returnValue = mbedtls_ssl_setup(&sslContext, &sslConfig)) != 0)
	{
		debug_printf("Operation failed, mbedtls_ssl_setup returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		return;
	}

	// Infinite loop
	while(1)
	{
		sslSessionIsActive = 1;

		// Reset SSL session
		SslResetSession(&clientFileDescriptor, &sslContext);

		// Allocate memory for HTTP buffer
		httpBuffer = pvPortMalloc(HTTPS_BUFFER_SIZE);
		if (httpBuffer == NULL)
		{
			debug_printf("Can not allocate memory for httpBuffer");
			return;
		}

		while(sslSessionIsActive == 1)
		{
			// Wait until a client connects
			debug_printf("Waiting for a remote SSL connection");

			if ((returnValue = mbedtls_net_accept(&listenFileDescriptor, &clientFileDescriptor, NULL, 0, NULL)) != 0)
			{
				debug_printf("Operation failed, mbedtls_net_accept returned %d", returnValue);

				// Free SSL resources
				SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
				vPortFree(httpBuffer);
				return;
			}

			mbedtls_ssl_set_bio(&sslContext, &clientFileDescriptor, mbedtls_net_send, mbedtls_net_recv, NULL);

#ifdef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
	// Setting maximal fragment size for requests with big content length
	if ((returnValue = mbedtls_ssl_conf_max_frag_len(&sslConfig, MBEDTLS_SSL_MAX_FRAG_LEN_2048)) != 0)
	{
		debug_printf("Operation failed, mbedtls_ssl_conf_max_frag_len returned %d", returnValue);

		// Free SSL resources
		SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
		vPortFree(httpBuffer);
		return;
	}

	// Get current fragment length
	debug_printf("Max fragment length = %d", mbedtls_ssl_get_max_frag_len(&sslContext));
#endif

			// Make handshake
			debug_printf("Performing the SSL/TLS handshake");

			while ((returnValue = mbedtls_ssl_handshake(&sslContext)) != 0)
			{
				if (returnValue != MBEDTLS_ERR_SSL_WANT_READ && returnValue != MBEDTLS_ERR_SSL_WANT_WRITE)
				{
					debug_printf("Operation failed, mbedtls_ssl_handshake returned %d", returnValue);

					sslSessionIsActive = 0;
					break;
				}
			}

			// Reset SSL session
			if (sslSessionIsActive == 0)
				break;

			// Read the HTTP Request
			debug_printf("Reading HTTP request");

			do
			{
				httpBufferLength = HTTPS_BUFFER_SIZE - 1;

				returnValue = mbedtls_ssl_read(&sslContext, (unsigned char *)httpBuffer, httpBufferLength);

				if (returnValue <= 0)
				{
					switch (returnValue)
					{
						case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY:
							debug_printf("SSL connection was closed gracefully");
							break;

						case MBEDTLS_ERR_NET_CONN_RESET:
							debug_printf("SSL connection was reset by peer");
							break;

						default:
							debug_printf("SSL mbedtls_ssl_read returned -0x%x", -returnValue);
							break;
					}

					break;
				}

				httpBufferLength = returnValue;

				if (returnValue > 0)
					break;
			}
			while (1);

			if (httpBufferLength == 0)
				httpBufferLength = sprintf((char *)httpBuffer, HTTP_RESPONSE_NOT_FOUND);
			else
			{
				// Parse HTTP request
				switch(PLS_ProcessHttpRequest((char *)httpBuffer, (size_t)httpBufferLength, &file, &httpUploadFileCurrentIndex, &httpUploadFileEndIndex))
				{
					// Request is not authenticated
					case PLS_HTTP_REQUEST_NOT_AUTHENTICATED:
						httpBufferLength = strlen((char *)httpBuffer);
						break;

					// Give out file
					case PLS_HTTP_FILE_EXIST:
						if (file != NULL)
						{
							if (file->len <= httpBufferIndex + HTTPS_BUFFER_SIZE)
							{
								// File size is smaller or equal to buffer size
								memcpy((char *)httpBuffer, file->data, file->len);
								httpBufferLength = file->len;
								httpBufferIndex = 0;

								// Close file
								fs_close(file);
							}
							else
							{
								// File size is bigger than buffer size
								memcpy((char *)httpBuffer, file->data, HTTPS_BUFFER_SIZE);
								httpBufferLength = HTTPS_BUFFER_SIZE;

								// Current index of the bytes left to be transferred
								httpBufferIndex += (int)HTTPS_BUFFER_SIZE;
							}
						}
						break;

					// Upload firmware file being uploaded
					case PLS_HTTP_FIRMWARE_UPLOADING:
						// Upload file till end of its size
						while (httpUploadFileCurrentIndex < httpUploadFileEndIndex)
						{
							do
							{
								httpBufferLength = HTTPS_BUFFER_SIZE;
								memset(httpBuffer, 0, httpBufferLength + 1);

								returnValue = mbedtls_ssl_read(&sslContext, (unsigned char *)httpBuffer, httpBufferLength);

								if (returnValue == MBEDTLS_ERR_SSL_WANT_READ || returnValue == MBEDTLS_ERR_SSL_WANT_WRITE)
									continue;

								if (returnValue <= 0)
								{
									switch (returnValue)
									{
										case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY:
											debug_printf("SSL connection was closed gracefully");
											break;

										case MBEDTLS_ERR_NET_CONN_RESET:
											debug_printf("SSL connection was reset by peer");
											break;

										default:
											debug_printf("SSL mbedtls_ssl_read returned -0x%x", -returnValue);
											break;
									}

									break;
								}

								httpBufferLength = returnValue;

								if (returnValue > 0)
									break;
							}
							while (1);

							// Start saving firmware file to SD
							if (httpUploadFileEndIndex > httpBufferLength + httpUploadFileCurrentIndex)
							{
								if (PLS_SaveFirmwareFileToSD((char *)httpBuffer, &httpUploadFileCurrentIndex, (size_t)(httpBufferLength + httpUploadFileCurrentIndex), httpUploadFileCurrentIndex) == 0)
									break;
							}
							else
							{
								if (PLS_SaveFirmwareFileToSD((char *)httpBuffer, &httpUploadFileCurrentIndex, httpUploadFileEndIndex, httpUploadFileCurrentIndex) == 0)
									break;
							}
						}

						// Response OK
						httpBufferLength = sprintf((char *)httpBuffer, HTTP_FILE_UPLOAD_JSON_OK);

						// Stop saving firmware file
						firmwareFileBeingUploaded = 0;

						break;

					// Upload firmware file uploaded
					case PLS_HTTP_FIRMWARE_UPLOADED:

						// Response OK
						httpBufferLength = sprintf((char *)httpBuffer, HTTP_FILE_UPLOAD_JSON_OK);

						// Stop saving firmware file
						firmwareFileBeingUploaded = 0;

						break;

					default:
					case PLS_HTTP_RESPONSE_NOT_FOUND:
						httpBufferLength = sprintf((char *)httpBuffer, HTTP_RESPONSE_NOT_FOUND);
						break;
				}
			}

			tmpCounter = 0;

			// Send prepared message
			while (1)
			{
				returnValue = mbedtls_ssl_write(&sslContext, (const unsigned char *)httpBuffer + tmpCounter, httpBufferLength - tmpCounter);

				// If connection was reseted - close it
				if (returnValue == MBEDTLS_ERR_NET_CONN_RESET)
				{
					debug_printf("Operation failed, peer closed the connection");

					sslSessionIsActive = 0;
					break;
				}

				// If error occured
				if (returnValue < 0 && returnValue != MBEDTLS_ERR_SSL_WANT_READ && returnValue != MBEDTLS_ERR_SSL_WANT_WRITE)
				{
					debug_printf("Operation failed, mbedtls_ssl_write returned %d", returnValue);

					// Free SSL resources
					SslFreeResources(&listenFileDescriptor, &clientFileDescriptor, &serverCertificate, &publicKey, &sslContext, &sslConfig, &sslCache, &randomByteGenerator, &entropy);
					vPortFree(httpBuffer);
					return;
				}

				// If the message was not sent till the end - continue
				if (returnValue > 0 && returnValue < (httpBufferLength - tmpCounter))
					tmpCounter += returnValue;
				else
				{
					// Check if the file was read and sent till the end
					if (file != NULL && httpBufferIndex != 0)
					{
						// Requested file exists
						if (file->len <= httpBufferIndex + HTTPS_BUFFER_SIZE)
						{
							// File size is smaller or equal to buffer size - read remaining bytes to buffer
							memcpy((char *)httpBuffer, file->data + httpBufferIndex, file->len - httpBufferIndex);
							httpBufferLength = file->len - httpBufferIndex;
							httpBufferIndex = 0;

							// Close file
							fs_close(file);
						}
						else
						{
							// File size is bigger than buffer size
							memcpy((char *)httpBuffer, file->data + httpBufferIndex, HTTPS_BUFFER_SIZE);
							httpBufferLength = HTTPS_BUFFER_SIZE;
							httpBufferIndex += (int)HTTPS_BUFFER_SIZE;
						}

						tmpCounter = 0;
					}
					else
						break;
				}
			}

			// Reset SSL session
			if (sslSessionIsActive == 0)
				break;

			while ((returnValue = mbedtls_ssl_close_notify(&sslContext)) < 0)
			{
				if (returnValue != MBEDTLS_ERR_SSL_WANT_READ && returnValue != MBEDTLS_ERR_SSL_WANT_WRITE)
				{
					debug_printf("Operation failed, mbedtls_ssl_close_notify returned %d", returnValue);

					sslSessionIsActive = 0;
					break;
				}
			}

			returnValue = 0;

			// Reset SSL session
			SslResetSession(&clientFileDescriptor, &sslContext);
		}

		// Free httpBuffer if exists
		if (httpBuffer != NULL)
			vPortFree(httpBuffer);
	}
}

@EvgeniyVasyliev Besides the fact you are parsing twice the server certificate, from a brief view, your code seems OK.
If you can't see the Client Hello message in wireshark(Have you enabled the correct filters?), you can use different methods, such as:

-tlsextdebug in your openssl s_client  command
use debug logs (with mbedtls_debug_set_threshold() and mbedtls_ssl_conf_dbg() functions).

The second option is preferred, as you can see failures in the real use case. But, the first option is also recommended, as you can learn the handshake in a more clear environment

Hi
I have the same problem witch mbedtls, lwip and https, @EvgeniyVasyliev did you solve the problem?

This project may help. It is a demo on the Windows platform, which is a new HTTPD module working with LWIP/MbedTLS, so it enables uploading/downloading files with any size.


⚠ Bofrost.de has degraded performance

In 02442ed, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1475 ms

Resolved: Bofrost.de performance has improved in d5334fc after 15 minutes.


Add the option to merge short edges into long ones

Double the default edge budget in spanGrid.
ref #8

Missing changelog.

Fixes the referenced issue.


Gupplyplex. illegal instruction, core dump

Finding strange output at the first step of the pipeline, im assuming it is trying to use guppyplex to collect demux data.
output looks like
RUNNING GUPPYPLEX COMMAND
Illegal instruction (core dump)
and that is repeated many many times, presumably for every barcode.
I do not believe this is an issue with the pipeline per se, because i can run the same parameters and data on a different machine with no obvious issues at this step.
So the question is, what is it with my VMM Ubuntu setup on this problematic machine, that is different to the machine that worked (I have no idea what parts to look at that could be important).
the reason im using this problematic machine is because its meant to have a more powerful CPU, so i just hope this core dump issue is just a matter to reallocating resources.

This kind of error was observed in ARM-v8 processors due to openBLAS core type not being recognised correctly, which was then fixed.
Is your processor Intel or ARM? Can you send the details of your processor  - output of cat /proc/cpuinfo?

So i've given Ubuntu 3 processors using VMM...
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 85
model name	: Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz
stepping	: 7
microcode	: 0xffffffff
cpu MHz		: 2095.078
cache size	: 11264 KB
physical id	: 0
siblings	: 3
core id		: 0
cpu cores	: 3
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni ssse3 cx16 pcid sse4_1 sse4_2 hypervisor lahf_lm invpcid_single ibrs_enhanced fsgsbase invpcid md_clear flush_l1d arch_capabilities
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 4190.15
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:
processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 85
model name	: Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz
stepping	: 7
microcode	: 0xffffffff
cpu MHz		: 2095.078
cache size	: 11264 KB
physical id	: 0
siblings	: 3
core id		: 1
cpu cores	: 3
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni ssse3 cx16 pcid sse4_1 sse4_2 hypervisor lahf_lm invpcid_single ibrs_enhanced fsgsbase invpcid md_clear flush_l1d arch_capabilities
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 4190.15
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:
processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 85
model name	: Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz
stepping	: 7
microcode	: 0xffffffff
cpu MHz		: 2095.078
cache size	: 11264 KB
physical id	: 0
siblings	: 3
core id		: 2
cpu cores	: 3
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni ssse3 cx16 pcid sse4_1 sse4_2 hypervisor lahf_lm invpcid_single ibrs_enhanced fsgsbase invpcid md_clear flush_l1d arch_capabilities
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 4190.15
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

the cat output was in the VMM
im using Oracle VM virtualbox Manager
host machine is a Windows 10 Pro.
I cant cat/proc on command line. perhaps an alternate command "wmic cpu" gives me
Intel64 Family  6 Model 85 Stepping 7
Intel(R) Xeon (R) Silver 4208 CPU@ 2.10GHz
8 Cores

Right, seems like  Oracle VM VirtualBox Manager is not exposing AVX and this might be the cause https://stackoverflow.com/questions/65780506/how-to-enable-avx-avx2-in-virtualbox-6-1-16-with-ubuntu-20-04-64bit.
However, if you are running on Windows 10, there is another easy way to run interARTIC without any VMs - natively on Windows using WSL. Have you got WSL installed - if not it is pretty straight forward https://www.windowscentral.com/install-windows-subsystem-linux-windows-10. This is the method I use to run interARTIC on my Windows laptop.

Perhaps Could you try this https://petri.com/how-to-disable-hyper-v-completely-in-windows-10?


BUG: Unrecognized CI/CDs

Describe the bug
This bug describes CI/CD tools that repositories may use to perform tests and/or releases. These CI/CDs could be detected by Scorecard when evaluating not only checks such as CI-Tests, Packaging and Signed-Releases, but also, Dangerous-Workflow (as suggested in https://github.com/ossf/scorecard/issues/3630), Pinned-Dependencies and Token-Permissions.
Reproduction steps
Expected behavior
Scorecard identifies CI/CDs tools other than GitHub Actions when evaluating repository pipelines.
Additional context
This CI Detector gem in Ruby can provide some insights on some CI/CDs used by the community:
https://github.com/ruby/ruby/blob/master/lib/rubygems/ci_detector.rb#L11-L25

is this issue intended to organize related issues? Should we use a project board status instead?

is this issue intended to organize related issues?

Yes.

Should we use a project board status instead?

Can be, if that's easier for organization.

Added  #4075 for Cirrus-CI


Adds in lazy execution for Lucene kNN queries

Description

Optimizes Lucene kNN query execution path in case of rewrites
The caveat here is that the rewrites would be deferred until weight creation. Any underlying changes to Lucene rewrite method would potentially be skipped with this execution mechanism.

Setup and Dataset

Opensearch docker container on a M1 Macbook Pro - Image ID: e1d9151cce32
Single node, default config
Load Gen: OSB vectorsearch workload running on local node hosting the docker container
Dataset: sift-128-euclidean.hdf5 (Params: https://github.com/opensearch-project/opensearch-benchmark-workloads/blob/main/vectorsearch/params/faiss-sift-128-l2.json)
Num docs: 1M, num shards: 2

Flame Graph
Default 2.18 code

Patched 2.18 code

Benchmarks
2.18 Default Code:

Metric
Task
Value
Unit

Min Throughput
prod-queries
20.93
ops/s

Mean Throughput
prod-queries
63.23
ops/s

Median Throughput
prod-queries
69.54
ops/s

Max Throughput
prod-queries
75.17
ops/s

50th percentile latency
prod-queries
10.6464
ms

90th percentile latency
prod-queries
13.7257
ms

99th percentile latency
prod-queries
21.3663
ms

99.9th percentile latency
prod-queries
71.429
ms

100th percentile latency
prod-queries
269.424
ms

50th percentile service time
prod-queries
10.6464
ms

90th percentile service time
prod-queries
13.7257
ms

99th percentile service time
prod-queries
21.3663
ms

99.9th percentile service time
prod-queries
71.429
ms

100th percentile service time
prod-queries
269.424
ms

error rate
prod-queries
0
%

Mean recall@k
prod-queries
0.97

Mean recall@1
prod-queries
0.98

Patched new 2.18 code:

Metric
Task
Value
Unit

Min Throughput
prod-queries
75.97
ops/s

Mean Throughput
prod-queries
79.29
ops/s

Median Throughput
prod-queries
78.68
ops/s

Max Throughput
prod-queries
83.04
ops/s

50th percentile latency
prod-queries
8.66315
ms

90th percentile latency
prod-queries
11.4286
ms

99th percentile latency
prod-queries
21.4076
ms

99.9th percentile latency
prod-queries
34.8355
ms

100th percentile latency
prod-queries
53.219
ms

50th percentile service time
prod-queries
8.66315
ms

90th percentile service time
prod-queries
11.4286
ms

99th percentile service time
prod-queries
21.4076
ms

99.9th percentile service time
prod-queries
34.8355
ms

100th percentile service time
prod-queries
53.219
ms

error rate
prod-queries
0
%

Mean recall@k
prod-queries
0.97

Mean recall@1
prod-queries
0.98

JFRs
JFR-patched-default.zip
Related Issues
Resolves #2115
Check List

[x] New functionality includes testing.
[x] New functionality has been documented.
[ ] ~API changes companion pull request created.~
[x] Commits are signed per the DCO using --signoff.
[ ] ~Public documentation issue/PR created.~

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@kotwanikunal can you fix the CIs. Change looks good to me as it is minial in terms of changing the code and getting the best performance out of the system

@kotwanikunal can you fix the CIs. Change looks good to me as it is minial in terms of changing the code and getting the best performance out of the system

@navneet1v I have updated the description with updated flame graphs and benchmarking numbers.
There are some fixes for the CI - I'll fix them shortly.

@kotwanikunal thanks. This p99 seems interesting. Rest all latency have decreased as expected.

@kotwanikunal can you please add the details like:

Setup.
Dataset used
for the benchmarks

@kotwanikunal can you please add the details like:

Setup.
Dataset used
for the benchmarks

Added to the description.

overall code looks good to me. One question I have is why we are not changing the DiversifyingChildrenByteKnnVectorQuery and DiversifyingChildrenFloatKnnVectorQuery in this PR? Is there some other PR that is taking care of this?
@kotwanikunal

NVM, I see this PR: https://github.com/opensearch-project/k-NN/pull/2283/files#diff-d6bb9cc296becc98be3ac4bddc74c2b1520d09ff8b7d77467b3a765df17c4c11 is handling that case.

Conflicts fixed. Will wait for CI to complete

The BWC test: k-NN Rolling-Upgrade BWC Tests (21, ubuntu-latest, 2.19.0-SNAPSHOT, 3.0.0-SNAPSHOT) will fixed once we have code for innerhits merges and added in 2.19 snapshot.


Any chance to list possible values of a specific parameter?

I need to display the possible values of a specific function parameter. Is there any way to do that?
E.g.:
record.field('path'); // when autocomplete path it should display a list of fixed strings.

You can write a plugin that does this, but it's a little tricky. The core library doesn't do it.


Events while in the background in iOS

Events while in the background in iOS

Is there a way to get those events while in the background in iOS? Whether not, what is the alternative? I should execute a code to reconnect a peer when the internet is back and the app is in the background. Thanks!

I'm not sure what your use case is, but as far as I know on iOS you have three states:
1- running (you are in the foreground and executing)
2- idle (you have been put in the background quite recently - some seconds - but are not killed yet
3- background / not doing anything - iOS transitions through idle quickly to this state, and now your code is not running at all. The app is effectively dead
There are only a few ways to wake up an app on iOS that is in state 3, things like react-native-background-geolocation, react-native-background-refresh, @react-native-firebase/messaging - I'm not aware of many more ways.
So if your app is in the background, and my understanding is correct, you don't do anything because you can't. You can use react-native built-in AppState listeners to listen for when you are foreground again, and you can use the packages mentioned above to maybe wake up the app at which point you can call netinfo fetch here to see what your internet status is.
Or maybe I'm misunderstanding iOS behavior and/or your use case.


CT16G: $closure is not idempotent; tests should not call with GET

Or at least they should expect GET to be unsuccessful when invoking $closure

It seems that GET on a $closure with only the name parameter should work -- it would be an idempotent action. Otherwise you are correct. Thanks for the bug report.


Serializable witness is incomplete

USome(1) is de facto serializable despite the fact that Int isn't a subtype of Serializable. (Although Integer is) The same applies to all AnyVal primitives and to Null when -Yexplicit-nulls is on. That being said, Serializable doesn't really work like that, so this witness is a bit symbolic to start with.
https://github.com/lourkeur/uoption/blob/ff4e3f9202f69d9d5edecc612630d30bc7d346e7/src/main/scala/uoption/package.scala#L40
3 possibilities:

statu quo.
UOption[A] subtypes Serializable regardless of A.
no witness. I'd rather not because this encodes intention nonetheless.

statu quo is still relatively nice because it statically enforces that the sentinel values are Serializable.


Help tooltip does not close when clicking on disassembly window

The tool tip window seems to be lingering in the background if it is not closed by the red x to the right.
Alt+Tab then shows a visual studio as a mini window of the asmdude tooltip.
Steps to reproduce:
Hover over asm instruction.
Click in the disassembly window to hide the tooltip.
Press Alt+Tab

Interesting, I'll investigate it.

Next version (after <IP_ADDRESS>) has this bug fixed. Proper housekeeping!


How can I send Metadata to server with each frame?

Hello @pedroSG94,
Is there any way to send metadata to the server with each and every frame? I would like to send the timestamp with each frame. I looked at a method that could send the metadata on connection, but is it possible to send it with each frame?
Thanks and Regards

Hello,
I assume that you want do it with RTMP.
Timestamp is already send with each frame in the rtmp message header:
https://github.com/pedroSG94/RootEncoder/blob/master/rtmp/src/main/java/com/pedro/rtmp/rtmp/message/Video.kt#L31
If you want send other info you will need modify the library to adjust to your server since rtmp don't have a standard way to do it.

Closing as inactive.


hist2array: return_edges returns the bin edges along each axis

Will replace #288 and includes @cbourjau's commits

Coverage increased (+0.002%) to 99.929% when pulling e277251f8aeb74e39a6db42e0cd7c6617fd4b93c on ndawe:hist_bin_edges into d1fd748e82d3bd7659998128bffa3f6649bd8b43 on rootpy:master.


Location and size not saved when maximized

Hi there!
Description
If you move the Livestreamer Twitch GUI (LTG) around on your screen or from monitor to another monitor, and then close it, the current size and position will be remembered when LTG is launched next time.
However, if you change the window to being maximized, the size and location are not remembered.
Expected / Actual behavior
I expected the window to be started maximized and on the screen it was last maximized on, when I close LTG while being maximized.
LTG instead opens in a windowed-mode in the last position I saved it as a window and not maximized.
Reproduction steps

Open LTG and resize it and change the position to anything but maximized
Close and reopen LTG, the window will have the position and size you closed it as
Maximize LTG and close the program.
Start the program and it will start with the size and location from point 2.

Environment details (operating system, etc.)
W10 x64
LTG: 0.15.2

Hi!
This is intended behavior. The maximized state is not being remembered, because for some reason, it is not that simple to implement in NWjs. For example, on OSX, NWjs triggers several move and resize events for an unknown time span before reaching the maximized state, which is super annoying. And on Windows, the application window gets moved outside of the viewport when maximizing it. I'm pretty sure that the location also varies from Windows version to Windows version and/or used desktop theme. This is just one of the reasons why I have not implemented this (yet).
I'll see if I can implement this feature once #275 (big NWjs upgrade) has been merged.


pull request for e2e test at 01/13/2017 04:15:07

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


After selecting something in the hamburger menu, the semantics don't update

This does not reproduce anymore.


Example how to read from IMFMediaStream

I try to get my head around a way to get a callback for samples encoded in the UWP encoding pipeline. As the pipeline is not as open as the Desktop version, there is (to my understanding) no built-in method to get callbacks (IMFAsyncCallback?). Right now I am able to write to file and encode into memory, however I constantly fail to implement a method that gives me an encoded IMFSample back after encoding. Here's a rough sketch of what happens:
Microsoft::WRL::ComPtr<IMFAttributes> spAttr;
MFCreateAttributes(&spAttr, 2);
spAttr->SetUINT32(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, false);
spAttr->SetGUID(MF_TRANSCODE_CONTAINERTYPE,
MFTranscodeContainerType_MPEG4);
Windows::Storage::Streams::InMemoryRandomAccessStream^ _spInMemoryRAS;
IMFByteStream * _spByteStream;
IMFSinkWriterEx * _pSinkWriter;
_spInMemoryRAS = ref new Windows::Storage::Streams::InMemoryRandomAccessStream();
hr = MFCreateMFByteStreamOnStreamEx((IUnknown*)_spInMemoryRAS, &_spByteStream);
if (SUCCEEDED(hr))
{
    hr = MFCreateSinkWriterFromURL(NULL, _spByteStream, spAttr.Get(),(IMFSinkWriter**)&_pSinkWriter);
}
...
hr = _pSinkWriter->BeginWriting();
...
IMFSample *pSample = NULL;
IMFMediaBuffer *pBuffer = NULL;
HRESULT hr = S_OK;
hr = prepareSample(&pSample, &pBuffer); // not shown for brevity...
// Send the sample to the Sink Writer.
if (SUCCEEDED(hr))
{
    hr = _pSinkWriter->WriteSample(_streamIdx, pSample);
}
...
hr = _pSinkWriter->Finalize();

The documentation on MSDN is not really helpful as it is for Desktop only. I guess I need to mess with BeginRead/BeginWrite methods on the IMFByteStream (probably inheriting from it???). I'm totally lost, Google and Stackoverflow is of no help there. Any chance to get sample code how to do that right?

The samples here should help.  Look at the issues section for additional information on how to make things work and what's left to resolve:
https://github.com/mjmeans/Media-extensions-sample
Microsoft points to old versions of these in their UWP docs.  Hopefully they will update some of these very important samples.


docs: Fix links master -> main

There are a few repos which have migrated from master to main this
reflects that change for the ones which have made the transition.
Additionally cleanup some End of Line whitespace.
Signed-off-by: Harold Dost<EMAIL_ADDRESS>

:+1: Thanks :)


Neovim Broken

On neovim:
Unhandled exception in thread started by <bound method PlugThread.__bootstrap of <PlugThread(PlugT-15, stopped<PHONE_NUMBER>50432)>>

I get the same error on mac.

@vheon What I see is, it seems to fail in the trace whenever one of my threads requests vim.current.buffer, which happens when they use the callback. Seems to relate to how neovim implemented compatibility for if_pyth.
The line crashing the code: https://github.com/junegunn/vim-plug/blob/master/plug.vim#L1108
[PlugT-15,19:44:54.963361] DeleteTrailingWhitespace: Dir /home/starcraftman/.nvim/bundle/DeleteTrailingWhitespace/
[PlugT-15,19:44:54.965270] + DeleteTrailingWhitespace: Installing ...
[PlugT-15,19:44:54.971276] x DeleteTrailingWhitespace: Trace:
Traceback (most recent call last):
  File "<string>", line 214, in manage
  File "<string>", line 239, in install
  File "<string>", line 282, in write
  File "<string>", line 90, in write
  File "<string>", line 105, in _write
  File "/usr/local/lib/python2.7/dist-packages/neovim/api/nvim.py", line 233, in buffer
    return self._session.request('vim_get_current_buffer')
  File "/usr/local/lib/python2.7/dist-packages/neovim/api/common.py", line 222, in request
    return walk(self._in, self._session.request(name, *args), self, name,
  File "/usr/local/lib/python2.7/dist-packages/neovim/msgpack_rpc/session.py", line 72, in request
    v = self._yielding_request(method, args)
  File "/usr/local/lib/python2.7/dist-packages/neovim/msgpack_rpc/session.py", line 137, in _yielding_request
    return parent.switch()
AttributeError: 'NoneType' object has no attribute 'switch'

This appears related to neovim/python-client#80 .

I've managed to get an almost fully working python installer on neovim on branch nvim_py . All buffer logic transfered to the main loop solves above isssue.
Interrupt no longer works though because the threads are running separately from neovim. Otherwise, just a minor buffer glitch where order of plugins jumps around.

I think this branch has demonstrated a nice speed improvement over old version. Change comes from lock reduction. Only downside is CTRL + C seems to lag a bit. With about 50 plugins on my slow i3 notebook I see following times:
Vim + nvim_py
7.005593
6.959201
6.843147

Vim + master
7.487281
7.430914
7.631373

See latest PR on junegunn's. Closing.