Files#createDirectories(Path) causes following operations to fail

We have some code which writes a file using Files#write(Path, byte[]) When the destination file system is the local one, it will fail if the parent directories of the output path do not already exist. So, we call Files#createDirectories(Path) before calling write to ensure that they have been created.
However, when the output file system is S3, the call to write fails with this exception:

Caused by: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: S3Client.makeMetaRequest has invalid client. The client can not be used after it is closed.
at app//software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:111)
at app//software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:47)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:223)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:218)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeRetryExecute(AsyncRetryableStage.java:182)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.lambda$attemptExecute$1(AsyncRetryableStage.java:159)
at java.base@17.0.7/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
at java.base@17.0.7/java.util.concurrent.CompletableFuture.uniWhenCompleteStage(Unknown Source)
at java.base@17.0.7/java.util.concurrent.CompletableFuture.whenComplete(Unknown Source)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.attemptExecute(AsyncRetryableStage.java:156)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeAttemptExecute(AsyncRetryableStage.java:136)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.execute(AsyncRetryableStage.java:95)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage.execute(AsyncRetryableStage.java:79)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage.execute(AsyncRetryableStage.java:44)
at app//software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at app//software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at app//software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.execute(AsyncExecutionFailureExceptionReportingStage.java:41)
... 81 more
Caused by: java.lang.IllegalStateException: S3Client.makeMetaRequest has invalid client. The client can not be used after it is closed.
at software.amazon.awssdk.crt.s3.S3Client.makeMetaRequest(S3Client.java:129)
at software.amazon.awssdk.services.s3.internal.crt.S3CrtAsyncHttpClient.execute(S3CrtAsyncHttpClient.java:163)
at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.doExecuteHttpRequest(MakeAsyncHttpRequestStage.java:204)
at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.executeHttpRequest(MakeAsyncHttpRequestStage.java:151)
at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.lambda$execute$1(MakeAsyncHttpRequestStage.java:104)
at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.thenAccept(Unknown Source)
at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.execute(MakeAsyncHttpRequestStage.java:100)
at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.execute(MakeAsyncHttpRequestStage.java:65)
at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallAttemptMetricCollectionStage.execute(AsyncApiCallAttemptMetricCollectionStage.java:62)
at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallAttemptMetricCollectionStage.execute(AsyncApiCallAttemptMetricCollectionStage.java:41)
at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.attemptExecute(AsyncRetryableStage.java:144)
... 88 more

If I comment out the call to Files#createDirectories(Path) it works correctly without issue. This leads me to believe that the implementation of createDirectories is doing something to the S3Client that it shouldn't (closing it perhaps?).

Hi @stuartfehr, it does seem like Files#createDirectories(Path) is making a sequence of calls one of which is closing the client before the full operation is complete.
Can you add which version of the library you are using?

It looks like we were
using software.amazon.nio.s3:aws-java-nio-spi-for-s3:2.0.0 at the time that
I reported this issue. Thanks.
On Mon, May 13, 2024 at 3:41 PM Mark Schreiber @.***>
wrote:

Hi @stuartfehr https://github.com/stuartfehr, it does seem like
Files#createDirectories(Path) is making a sequence of calls one of which is
closing the client before the full operation is complete.
Can you add which version of the library you are using?
—
Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-java-nio-spi-for-s3/issues/435#issuecomment-2108849271,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAFMYQ37PKAJDYTSAS3E7G3ZCEXRRAVCNFSM6AAAAABGDDY2DGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBYHA2DSMRXGE
.
You are receiving this because you were mentioned.Message ID:
@.***>

Can you share some example code. I just ran this simple program and it appears to work without an issue. This was using main although 2.0.1 should also be equivalent.
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;

public class CreatePrefix {
    public static void main(String[] args) throws IOException, URISyntaxException {
        var bucketName =  args[0];
        var prefix = args[1];

        if (!prefix.endsWith("/")) {
            prefix += "/";
        }

        var pathUri = Path.of(new URI("s3://" + bucketName + "/" + prefix));

        var pathCreated = Files.createDirectories(pathUri);
        System.out.println("Created:" + pathCreated);
    }
}

This seems to replicate the error. I will investigate.

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;

public class CreatePrefix {
    public static void main(String[] args) throws IOException, URISyntaxException {
        var bucketName =  args[0];
        var prefix = args[1];

        var pathUri = Path.of(new URI("s3://" + bucketName + "/" + prefix));

        var pathCreated = Files.createDirectories(pathUri);
        Files.write(pathCreated, "test-data".getBytes());

        System.out.println("Created:" + pathCreated);
    }
}

I have made some commits in main that should fix this.

Thank you!
On Tue, May 14, 2024 at 8:34 AM Mark Schreiber @.***>
wrote:

Closed #435
https://github.com/awslabs/aws-java-nio-spi-for-s3/issues/435 as
completed.
—
Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-java-nio-spi-for-s3/issues/435#event-12803512703,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAFMYQ2JYSUVQXV6OZGX7K3ZCIOHFAVCNFSM6AAAAABGDDY2DGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSHAYDGNJRGI3TAMY
.
You are receiving this because you were mentioned.Message ID:
@.***
com>

@markjschreiber
AFAICT, this is not fixed in the recent version 2.0.2. Also your replication example fails on my machine.
Could you have another look into this?

Thanks. There was an issue in the cache logic. I have pushed a commit to main. Let me know if you still have issues with it.

Thanks for the fix!
Any chance for an expedited release on this? I was hoping to get this fix in 2.0.2.

I can make a 2.0.3 release?

A new release with this fix is here https://github.com/awslabs/aws-java-nio-spi-for-s3/releases/tag/2.0.3
It has been sent Maven Central but usually takes a few hours to show up.


Objective player for services without liability contract

When I use robonomics protocol to let user use a CPS service for free, I mean when on Demand recieved I do something immediately and return a Result type message, I currently have to implement my own objective player.
Result response packing support necessary as well. You may consider manually packing here.
Enhancement proposal

Implement #86 to manupulate with model and objective data,
Implement objective player (or more general framework) for services without liability contracts.
[WIP]

Closed in #109


TriangleColorPicker rotating with flickering on IOS

Hi there, I have some issue with TriangleColorPicker.
On IOS device, color trianlge rotating with flickering and color indicator (small black circle) don't move.
But it started working after changing screen orientation.
I use the last version of this lib - 0.52
RN - 0.59.9
React - 16.8.3

flickering effect is side-effect of hack around one problem with RN - but can be adjusted - see https://github.com/instea/react-native-color-picker/issues/17#issuecomment-575664502

@sodik82, thank you for the answer, I'll try that solution.

RotationHackFactor prop value from 5 to 15 resolves this issue.
But I can't use it, before #35 PR, so @sodik82, could you please apply this PR?
And I'll close this issue right away.

can you try 0.6.0-rc.1?

Hi, was this ever truly resolved in the latest version? I am seeing an issue with the halo picker getting stuck on the left side as well in iOS. We are back on 0.4.5 still but did a quick update to the latest 0.6.0 but ran into other issue with the latest version so we were wondering if it was worth trying to resolve the other issues or if we need to move to another picker?


Errors aren't logged before process is ended

JS errors (e.g. using an undefined variable) aren't logged until the process is ended.

Fixed with recent rewrite from ground up


Show Book permissions Directly on Book Cards

Describe the feature you'd like
Currently I have to open a Book, and click "Permissions" to see this information.
I would like to see it directly on the book item on the books list, so I can see the permission for all listed books at once instead of opening one by one.
Some suggestions, in the case this implementation add too much clutter to the UI

Make it optional
Click on button to reveal this information
Hover a button to reveal this information (for instance an "i" icon)

I made a draft mockup suggestion showing the group name, followed by icons representing "View, Create, Edit and Delete" permissions.

It would be nice to have this feature on both List and Grid modes.
Describe the benefits this would bring to existing BookStack users
At my company, Groups and Permissions, are used to control the visibility of content according to the Groups assigned to the user.
For instance, there are book visible to "Engineering", but not to "Operations" or "Customer".
It is harder and prone to error to manage all books with this information "hidden". Sometime a book that should not be visible to some Group is left visible by mistake.
Can the goal of this request already be achieved via other means?
No. I cannot see permission for multiple books at once, as far as I am concerned.
Have you searched for an existing open/closed issue?

[x] I have searched for existing issues and none cover my fundemental request

How long have you been using BookStack?
1 to 5 years
Additional context
No response

Thanks for the request @andriykrefer but this is not something I can see implementing with the core project, since I see this detail as too granular for being exposed at higher level views.
I would see #1736 and #3739 as being more appropriate solutions for reviewing permissions at a wider scale.

Can the goal of this request already be achieved via other means?

While not direct, it could be possible to build reports via our API, since that now provides permission information.
That said, for your described use-case, you'd maybe actually want to know resolved permission status, rather than defined permission rules, which is not something we expose in a user-facing manner right now.

Thanks for the response @ssddanbrown

I see this detail as too granular for being exposed at higher level views.

I agree it is too granular when you consider chapters and pages level permissions. But I would suggest only book level permissions on the card.

I would see #1736 and #3739 as being more appropriate solutions for reviewing permissions at a wider scale.

#1736 would solve this issue for me as well! Any plans on implementing that?

it could be possible to build reports via our API

Nice to know there is a way through the API, but a core implementation would be preferred to a hacked workaround

I'm going to go ahead and close this off as per my reasoning above, and since #1736 would be a preferred alternative to the fundemental goal here.

#1736 would solve this issue for me as well! Any plans on implementing that?

No plans at the moment, but I don't plan too far in advance.


implement an efficient overlaps function for collections of Locatable

We should probably adapt the IntervalTree from htsjdk to work for us.  We've run into a number of cases where this is needed, in Valentine's exome code and in Tom's hadoop reader.  We could use both
boolean overlaps(Locatable locatable, IntervalTree<Locatable> locatables)
and
Set<Locatable> getOverlapping(Locatable locatable, IntervalTree<Locatable> locatables)

assigning to me but @cmnbroad will work on it

Reassigning to @edwardkw

I got one. Microbenchmark shows it's 70x faster than a linear search.

For the record, I only needed the IntervalVariantFilterin #792 because of a bug in VariantWalker, which I've now fixed so its no longer a use-case for this.

@jean-philippe-martin Want to add your solution to SimpleInterval or IntervalUtils?  This need shows up pretty often.

@lbergelson sure, I can split it off and make a separate pull request. Remind me in a bit if you don't see it in your inbox.

There you go, it's PR #892.

This is done -- IntervalsSkipList satisfies this ticket. Closing


When evaluating the model I encounter an error can you help me

I face this error when evaluating the model can you please help me.
Thank you.

Hi,
the error was caused by not training the model enough and doing the evaluation. While training add a suiitable epoch parameter (prefereablly around 40 or more for the benchmark dataset used in this paper). I have updated the README.md please refer to the updated commandes mentioned in README.md
Best regards,
Rashad


AMD build for ECharts 3.0

Hi ECharts!
Awesome to see 3.0, demos look amazing!
One thing I'm interested to know is whether it is still possible to build Echarts with chart types as different modules (files).
In 2.x, it is possible to load minimal echarts.js and then include chart types based on whether it was used or not.
Your web based builder seems to always create one file with all selected features. However, it would be good to be able to load charts dynamically. The dist folder also doesn't seem to have charts subfolder anymore. Is there any reason for that? And is there any way to load minimal ECharts and then decide what other features to load in runtime?
Thanks a lot, looking forward to use 3.0!

Hi Jarben, although 2.x support chart dynamic loading, the minimal echarts.js is still very large. The size is almost 400k. And I think it's difficult to achieve small core size after built, or we need to move common modules shared with several charts to each charts built, which will cause redundancy. So I suggest if you wan't to be able to load charts dynamically, load the source code with RequireJS, or any library else supporting loading AMD module.
Thanks for the support.

Hi Pissang,
thanks for your answer - makes sense, will now jump into testing it:)
Thanks,
Jaro


version cocossd 2.0.4 does not work use 2.0.3 model

so after the update 2.0.4 for coco-ssd cdn kept saying issues about loadmodelgraph undefined so I thought I would let you guys know to use 2.0.3 with this https://cdn.jsdelivr.net/npm/<EMAIL_ADDRESS>in your script tags otherwise you have have bad time cuz it didnt work when I just had https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd right after da update liek bro u gonna just make a new version dat ruin everyding.  LOL but ye jus bein bro lul

@el1tehAx0r
I think this issue is more related to TF models repo. Please, raise an issue in models repo from here.Thanks!


Add Find a Course footer properly

Description
LEARNER-5785
Find a Course is now added even when the user doesn't have enrolled in any course.

Logged in with facebook account having no course enrolled in, still 'Find a course' card is missing.

@farhan working just fine for me on the same user:

Profile
My Courses

p.s. Fb auth doesn't work our dev builds, did you make a prodRelease build to test it?

Hai @miankhalid, this version isn't supported yet enrollment using mobile apps? because I running it and cannot find any courses even I press Find a Course button.
here my yalm config:
COURSE_ENROLLMENT :
{
'TYPE': 'native',
'native': {
    'COURSE_SEARCH_URL':'http://myedx/api/courses/v1/courses/',
    'EXPLORE_SUBJECTS_URL':'http://myedx/api/courses/v1/courses/',
      'SEARCH_BAR_ENABLED': true,
      'SUBJECT_DISCOVERY_ENABLED': true,
    'COURSE_INFO_URL_TEMPLATE':'http://myedx/api/courses/v1/courses/'

}

sorry for my bad English

Whats the error that you are facing exactly @simbelekete ?

@miankhalid thanks for reply .
my issue is :
if i using native mode in yaml file configuration, it will not showing anything courses on find courses or discovery. but if I change to webview and  when I login to application and touch discovery tab it will show the course from webview interface, but the problem is user have to relogin/register again. so it only show the webview like browser I think. not integration yet with user that login before using apps.
is there are others API like enrollment API that must be put on .yaml file?
here the video of my issue:
video issue 13 seccond
Thank You

First of all the webview shouldn't show the header-footer of the site while displaying courses in it and should open the exact courses discovery page. Check to see if you using http://webview.my_edx_instance.com sort of URL to display in the webview.
For native view, what does the following API responds with when u hit it on ur server in a normal browser?
    @GET("/api/courses/v1/courses/")
    Call<Page<CourseDetail>> getCourseList(@Query("username") final String username,
                                           @Query("mobile") final boolean mobile,
                                           @Query("org") final String org,
                                           @Query("page") final int page);

@miankhalid thank you verymuch, I'll try soon. still on trip now.


api_swagger_cors example fails with api event reference error

Steps to reproduce:

cd serverless-application-model/examples/2016-10-31/api_swagger_cors
aws cloudformation package --template-file template.yaml --output-template-file packaged_template.yaml --s3-bucket <bucketname>
aws cloudformation deploy --template-file packaged_template.yaml --stack-name MySamSwagger --capabilities CAPABILITY_IAM

The deploy step above produces the following output error:
Waiting for changeset to be created..

Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [LambdaFunction] is invalid. Event with id [ProxyApiRoot] is invalid. RestApiId property of Api event must reference a valid resource in the same template.

I'm very confident that this bug was introduced after 2016-12-21T23:00:00Z, because I had a successful deployment around that time.

Yeah, this bug was introduced recently. As a workaround you can remove the !Ref and use RestApiId: ApiGatewayId directly. It should work.
We will get it fixed soon

This should be fixed now. Can you check?

Yup, this bug is fixed. Thanks for being on top of it


Serialize odometry data

Replaces #550.

By the way, this PR is almost line-for-line identical to #548, /s/IMU/Odometry. And a similar one will be  forthcoming for fixed frame pose data in 3D. Perhaps this could be somehow simplified? Introducing all these getters for the optimization problem and the pose graph is noise, IMHO.
It would be nice if we had all these MapByTime objects in a single structure in the optimization problem, and if we could just ask this structure to serialize itself from MapBuilder.

Updated. I also forgot to expose AddOdometryData in the SPG base class in mapping/sparse_pose_graph.h, so I added it.

@wally-the-cartographer merge

Merge requested by authorized user wohe. Merge queue now has a length of 2.


Add Authorization Header to Websocket for Vue Cli Plugin setup?

Hi,
I am able to add Authorization to the Http call but not able to add it to Websocket. Attaching my setup below:
import Vue from 'vue'
import VueApollo from 'vue-apollo'
import {
  createApolloClient,
  restartWebsockets
} from 'vue-cli-plugin-apollo/graphql-client'

// Install the vue plugin
Vue.use(VueApollo)

// Name of the localStorage item
const AUTH_TOKEN = 'apollo-token'
// return the headers to the context so httpLink can read them

// Http endpoint
const httpEndpoint = process.env.VUE_APP_GRAPHQL_HTTP,

// Files URL root
export const filesRoot =
  process.env.VUE_APP_FILES_ROOT ||
  httpEndpoint.substr(0, httpEndpoint.indexOf("/graphql"));

// Config
const defaultOptions = {
  // You can use `https` for secure connection (recommended in production)
  httpEndpoint,
  // You can use `wss` for secure connection (recommended in production)
  // Use `null` to disable subscriptions
  wsEndpoint: process.env.VUE_APP_GRAPHQL_WS,
  // LocalStorage token
  tokenName: AUTH_TOKEN,
  // Enable Automatic Query persisting with Apollo Engine
  persisting: false,
  // Use websockets for everything (no HTTP)
  // You need to pass a `wsEndpoint` for this to work
  websocketsOnly: false,
  // Is being rendered on the server?
  ssr: false,

  // Override default apollo link
  // note: don't override httpLink here, specify httpLink options in the
  // httpLinkOptions property of defaultOptions.
  // link: myLink

  // Override default cache
  // cache: myCache

  // Override the way the Authorization header is set
  getAuth: tokenName => {
    // get the authentication token from local storage if it exists
    const token = 'Bearer ' + localStorage.getItem("id_token");
    // return the headers to the context so httpLink can read them
    return token || ''
  },

  // Additional ApolloClient options
  // apollo: { ... }

  // Client local data (see apollo-link-state)
  // clientState: { resolvers: { ... }, defaults: { ... } }
}

// Call this in the Vue app file
export function createProvider(options = {}) {
  // Create apollo client
  const {
    apolloClient,
    wsClient
  } = createApolloClient({
    ...defaultOptions,
    ...options,
  })
  apolloClient.wsClient = wsClient

  // Create vue apollo provider
  const apolloProvider = new VueApollo({
    defaultClient: apolloClient,
    defaultOptions: {
      $query: {
        // fetchPolicy: 'cache-and-network',
      },
    },
    errorHandler(error) {
      // eslint-disable-next-line no-console
      console.log('%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', error.message)
    },
  })

  return apolloProvider
}

// Manually call this when user log in
export async function onLogin(apolloClient, token) {
  if (typeof localStorage !== 'undefined' && token) {
    localStorage.setItem(AUTH_TOKEN, token)
  }
  if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
  try {
    await apolloClient.resetStore()
  } catch (e) {
    // eslint-disable-next-line no-console
    console.log('%cError on cache reset (login)', 'color: orange;', e.message)
  }
}

// Manually call this when user log out
export async function onLogout(apolloClient) {
  if (typeof localStorage !== 'undefined') {
    localStorage.removeItem(AUTH_TOKEN)
  }
  if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
  try {
    await apolloClient.resetStore()
  } catch (e) {
    // eslint-disable-next-line no-console
    console.log('%cError on cache reset (logout)', 'color: orange;', e.message)
  }
}

Can you help me with this?
Thanks.
Cheers,
Ashish

I see the same behavior. Stepping through the source code this looks like the probable cause:
https://github.com/Akryum/vue-cli-plugin-apollo/blob/b99182283eeb8ea49336bb1617a309269d32dc8b/graphql-client/src/index.js#L44
vue-apollo never attempts to use the getAuth set by the developer, it always falls back to the default, and does not set authorization headers as requested.

@agosto-chrisbartling I only use defaultGetAuth if you don't pass any value for getAuth, that's how default values work in JavaScript. So your analysis is incorrect.

Not Chris, but this is trivial to reproduce.
I will leave you to it
const defaultOptions = {
	wsEndpoint: < validAddress > ,
	...
	getAuth: () => {
		console.log(`Making auth token: Bearer ${token}`);
		return `Bearer ${token}`;
	}
	...
}

Observe getAuth is never called

Not sure how I got pulled into this conversation.

@Akryum For now, I am overiding the WSClient creation by extracting it out of your library & setting it up as a duplicate in my project, as I need to pass Authorization headers to wsClient & httpLink in different way.
I may be missing something here, but there must be a cleaner way to do it?
wsClient = new _subscriptionsTransportWs.SubscriptionClient(wsEndpoint, {
                reconnect: true,
                connectionParams: {
                    "headers": {
                        authorization: getAuth(tokenName)
                    }
                }
            }); // Create the subscription websocket link

            var wsLink = new _apolloLinkWs.WebSocketLink(wsClient);

authLink = (0, _apolloLinkContext.setContext)(function (_, _ref2) {
            var headers = _ref2.headers;
            var authorization = getAuth(tokenName);
            var authorizationHeader = authorization ? {
                authorization: authorization
            } : {};
            return {
                headers: _objectSpread({}, headers, authorizationHeader)
            };
        }); // Concat all the http link parts

@agosto-chrisbartling Sorry! The autocomplete did something strange :confused:
@agosto-levitomes See a working example: https://github.com/Akryum/vue-apollo/blob/master/tests/demo/src/vue-apollo.js

@agosto-levitomes See a working example: https://github.com/Akryum/vue-apollo/blob/master/tests/demo/src/vue-apollo.js

Thanks for sharing, that is the example I started working from. I then started vue-apollo via vue add apollo, and accepted example code in case I had made a mistake. That working example does not use websockets.
I'm sorry to say it is not a working example in regards to  getAuth for websockets/getting the correct headers on a websocket request.
getAuth from the users defaultOptions Is not called. Simply add a comment to the method in your demo (and a ws endpoint), and run it it to observe this. The default getAuth method from https://github.com/Akryum/vue-cli-plugin-apollo/blob/b99182283eeb8ea49336bb1617a309269d32dc8b/graphql-client/src/index.js#L186 is always called. Hence why @ashishwadekar went through all that effort to abstract add auth headers.
It does work for http/s requests.

It does use websockets: https://github.com/Akryum/vue-apollo/blob/master/tests/demo/src/vue-apollo.js#L17

@ltomes @Akryum What I have observed is that getAuth works but only to set headers on httpLink & not on the wsClient.  wsClient expects connectionParams & block pertaining to it which is different from httpLink. Ideally once the token is found there could be the following scenarios:

Add authorization headers to httpLink the default way. This is happening now.
Add authorization headers to wsClient with connectionParams. Not happening now.
Options to consider whether authorization headers be set in same way or different way for httpLink & wsClient. Cannot see this in current implementation.

@Akryum Share you thoughts on this. Cheers.

@Akryum is this considered to be implemented? Can I help in some way?

@Akryum Any updates on this one?

SO should https://github.com/Akryum/vue-cli-plugin-apollo/blob/b99182283eeb8ea49336bb1617a309269d32dc8b/graphql-client/src/index.js#L106 be:
return authorization ? { headers: { authorization  } } : {};

As per this example?

So is there currently any way to add authorization headers to websocket calls?
I think I just hit this issue. With the default setup, setting my token works fine for HTTP calls, but websocket calls complain that no token is set. Using Hasura for the backend. If I'm doing things correctly for one, I'd expect them to work for the other.

@ndarilek I've not tackled this one yet. I'm currently handing up what would otherwise be in this header as a first-class argument in any WebSocket subscriptions that would require authentication.
@ashishwadekar seemed to have posted a monkey-patch above that appears to do the job.

I'd be interested in seeing a full example of how to set up a client using the above monkeypatch, or at the very least, how to configure my own client and make it available to vue-apollo. I'll keep hacking on things here, and if I get something more complete working then I'll post it here.
But this is definitely non-functional. Unfortunately I don't have control over the GraphQL server (Hasura) so, to the best of my knowledge, it's authorization headers or nothing.

A workaround is to manually override the connection params.
// Call this in the Vue app file
export function createProvider (options = {}) {
  // Create apollo client
  const { apolloClient, wsClient } = createApolloClient({
    ...defaultOptions,
    ...options
  })

  // Override connection params
  wsClient.connectionParams = () => {
    return {
      headers: {
        Authorization: localStorage.getItem(AUTH_TOKEN) ? `Bearer ${localStorage.getItem(AUTH_TOKEN)}` : ''
      }
    }
  }

  // Set apollo client's websocket client
  apolloClient.wsClient = wsClient

  // Create vue apollo provider
  const apolloProvider = new VueApollo({
    defaultClient: apolloClient,
    defaultOptions: {
      $query: {
        // fetchPolicy: 'cache-and-network',
      }
    },
    errorHandler (error) {
      // eslint-disable-next-line no-console
      console.log('%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', error.message)
    }
  })

  return apolloProvider
}

@leemarlow That worked perfectly for me. Solid find. Thanks!

@leemarlow thanks, that looks solid, any idea how to implement this in Nuxt? I tried to create a plugin and overwrite the wsClient without luck:
export default (context) => {
  const client = context.app.apolloProvider.defaultClient
  const token = localStorage.getItem('token')

  client.wsClient = {
    ...client.wsClient,
    connectionParams: () => {
      return {
        headers: {
          Authorization: token ? `Bearer ${token}` : ''
        }
      }
    }
  }
}

@leemarlow Thanks, this looks lots cleaner than my initial workaround. I'm trying to implement your fix now, because my original didn't account for onLogin restarting the websocket connection when authentication parameters change. I'm hitting an issue, though:
  const { apolloClient, wsClient } = createApolloClient({
    ...defaultOptions,
    ...options
  })

  console.log("Apollo client", apolloClient)
  console.log("WS client", wsClient)

In the above code, apolloClient is defined but wsClient is undefined, so this fails:
  // Override connection params
  wsClient.connectionParams = () => {
...

Any suggestions for a quick fix? I guess I can chase this through the labyrinth that is Apollo and the Vue plugin, but I'm on a bit of a time crunch and am hoping there may have been a cut-and-paste error somewhere.
Thanks!

Oh, never mind, I see I wasn't passing in the correct configuration parameters because my previous solution hacked around those. Apologies for the noise.

I'm coming to this as a neophyte and I wonder if someone could review and encapsulate the results of this discussion.  What edits need to be made to vue-apollo.js, and if necessary to vue-cli-plugin-apollo/graphql-client/src/index.js, to make vue-apollo work with hasura?  I am trying to get hasura's sample application vuejs-auth0-graphql to work and I found my way here in the process of struggling with this error:

GraphQL error: Missing Authorization header in JWT authentication mode

Tracing the code I found that no token was retrieved from localStorage.
I had had to add import { InMemoryCache } from 'apollo-cache-inmemory'; and cache: new InMemoryCache(), to vue-apollo.js in that sample.  It wasn't there initially.  Also, for good measure, I was able to verify that hasura is properly configured and returning a JWT following directions at https://docs.hasura.io/1.0/graphql/manual/guides/integrations/auth0-jwt.html.

No time for any extensive help, but here is my src/vue-apollo.ts which
connects to Hasura via websockets.
You can drop the prevApolloToken check--we have to reauthenticate for
Auth0 account linking. You can probably also ignore the unauthClient.
I have a situation where the client should never authenticate so Hasura
won't assign it a non-anonymous role. But this is what I came up with
after reading this thread and hacking through this mess until I got
something that worked. :) Improvements welcome..

import Vue from "vue"
import VueApollo from "vue-apollo"
import { createApolloClient, restartWebsockets } from
"vue-cli-plugin-apollo/graphql-client"

// Install the vue plugin
Vue.use(VueApollo)

// Name of the localStorage item
const AUTH_TOKEN = "apollo-token"

// Http endpoint
// const httpEndpoint = process.env.VUE_APP_GRAPHQL_HTTP ||
"http://localhost:8080/graphql"

const wsProtocol = (window.location.protocol === "https:") ? "wss" : "ws"

// Config
const defaultOptions = {
   // You can use `https` for secure connection (recommended in production)
   // httpEndpoint,
   // You can use `wss` for secure connection (recommended in production)
   // Use `null` to disable subscriptions
   wsEndpoint: process.env.VUE_APP_GRAPHQL_WS ||
`${wsProtocol}://${window.location.host}/graphql`,
   // LocalStorage token
   tokenName: AUTH_TOKEN,
   // Enable Automatic Query persisting with Apollo Engine
   persisting: false,
   // Use websockets for everything (no HTTP)
   // You need to pass a `wsEndpoint` for this to work
   websocketsOnly: true,
   // Is being rendered on the server?
   ssr: false,

   // Override default apollo link
   // note: don't override httpLink here, specify httpLink options in the
   // httpLinkOptions property of defaultOptions.
   // link: myLink

   // Override default cache
   // cache: myCache

   // Override the way the Authorization header is set
   // getAuth: (tokenName) => ...

   // Additional ApolloClient options
   // apollo: { ... }

   // Client local data (see apollo-link-state)
   // clientState: { resolvers: { ... }, defaults: { ... } }
}

// Call this in the Vue app file
export function createProvider (options = {}) {
   // Create apollo client
   const { apolloClient, wsClient } = createApolloClient({
     ...defaultOptions,
     ...options
   })

   // Override connection params
   wsClient.connectionParams = () => {
     const token = localStorage.getItem("prevApolloToken") ||
localStorage.getItem(AUTH_TOKEN)
     if(token)
       return { headers: {
         Authorization: `Bearer ${token}`,
       } }
     else
       return {headers: {}}
   }

   // Set apollo client's websocket client
   apolloClient.wsClient = wsClient

   // Create an Apollo client that will never authenticate.
   const unauth = createApolloClient({
     ...defaultOptions,
     ...options
   })

   // Create vue apollo provider
   const apolloProvider = new VueApollo({
     clients: {
       default: apolloClient,
       unauth: unauth.apolloClient,
     },
     defaultClient: apolloClient,
     defaultOptions: {
       $query: {
         // fetchPolicy: 'cache-and-network',
       }
     },
     errorHandler (error) {
       let message = ""
       if(error.originalError)
         message = error.originalError
       else
         message = error.message
       // eslint-disable-next-line no-console
       console.log("%cError", "background: red; color: white; padding:
2px 4px; border-radius: 3px; font-weight: bold;", message)
     }
   })

   return apolloProvider
}

// Manually call this when user logs in
export async function onLogin (apolloClient: any, token: string) {
   if (typeof localStorage !== "undefined" && token) {
     localStorage.setItem(AUTH_TOKEN, token)
   }
   if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
   try {
     await apolloClient.resetStore()
   } catch (e) {
     // eslint-disable-next-line no-console
     console.log("%cError on cache reset (login)", "color: orange;",
e.message)
   }
}

// Manually call this when user log out
export async function onLogout (apolloClient: any) {
   if (typeof localStorage !== "undefined") {
     localStorage.removeItem(AUTH_TOKEN)
   }
   if (apolloClient.wsClient) restartWebsockets(apolloClient.wsClient)
   try {
     await apolloClient.resetStore()
   } catch (e) {
     // eslint-disable-next-line no-console
     console.log("%cError on cache reset (logout)", "color: orange;",
e.message)
   }
}

Thank you @ndarilek. The problem was only my cobweb-ridden brain.  I had not yet logged into Auth0 and I got freaked because I didn't expect the console to show errors at that point in the UX.  But this is a sample app whose purpose is to demonstrate the core functionality of the stack and in hindsight I'm wiser.  Anyway, I logged in, the token returned, got passed to hasura, and the data got rendered.  All good now.

Doing some spring cleaning since it's not related to the repository.


Do not replace default route

The issue have been mentioned all over the place, but the problem is still there: I don't want to route all my network traffic through the VPN, only connections towards devices on my LAN should go through VPN.
I configured SoftEther and it seemed to work OK, until I found out that it actually routes all network traffic through default gateway on my LAN, which is something that I absolutely don't want to do. There must have been a clear option to enable/disable that during configuration of the server/client; SoftEther, however, doesn't have that.
Many similar questions mention that "No Adjustments of Routing Table" should be enabled, this however absolutely does not work. When I'm not connected, https://www.google.com/search?q=ip reports my IP as 158.181.xx.xx, when I connect to SoftEther VPN google reports that my public IP is 94.143.xx.xx. Changing "No Adjustments of Routing Table" doesn't affect that IP change reported by google.
The other HUGE problem with SoftEther is that it seems to insist that TCP should be used. Which is really problematic over lossy networks. Because of that combination of SoftEther bugs (only TCP and default route override) at some point I started to have huge network issues because TCP degrades really badly if connection is lossy, and after debugging I realized that SoftEther overrides default route, huge NO-NO! I saw there is also VPN over DNS and ICMP, but I don't want to do that, I want plain UDP on some other port!

As mentioned elsewhere I had to change "interface metric" to some high value from 1 that was set there:

this seems to be IPv4 though, no idea if that would also work for ipv6


Made the website HTTPS-compatible by using HTTPS URLs

Made the website HTTPS-compatible by using HTTPS URLs for resources and links.

:+1:


Problems with router on tns-core-modules v2.4.1

Hi! I'm hiving some issues with the router. Here are my settings:

tns-core-modules: 2.4.1
angular router: 3.1.2
tns-android : 2.3.0
typescript: ^2.0.10

The problem is the following:
I have a login screen and a dashboard after it, When I log in, it navigates without problem and then the whole app works great. But as soon as I relaunch the app, either tns run, tns livesync, or simply killing the app on the device, the router just won't work. I have to log out (which doesn't route me to the log in screen, it stays on the same screen with everything white but the action bar) then kill the app, start it again and log in back again to be able to navigate through the app.
I added a console.log(); before this._router.navigate(['/anything']); and it logs it, and also (weirder yet) I have a console.log(); inside the ngOnInit() method of the next screen and, sometimes, it logs it even though the app is not navigating
I didn't have this issue on tns-core-modules: 2.3.0 but I had the issue that the navigation was very slow with the white veil.. So I guess it has something to do with the version 2.4.1
Any help on this would be appreciated.
Thanks in advance

I found the problem. I had a transition between the login and dashboard and that was causing the problem. I removed the transition and now it's fixed.


Wrong states when pressing Back button

To start, the whole library is screwed up, so many issues and so many hours lost. I'd suggest not releasing a crappy library so that hundreds of people don't waste their time.
Now onto the issues.

On the Demo page at http://browserstate.github.io/history.js/demo/ if you click states -> 1 -> 2 -> 3 in order and press Back button you should get [state 2] and instead you are getting [state 1] (Firefox 48, Chrome 49)
On my own clean page, switching states from A to B to C, and while on page C clicking Back button gives me state C, not expected B. Really? Did anyone even test this?
And another serious issue that was discussed before: when you say it supports HTML5 History API, it doesn't. With a standard history API when I [pushState] nothing gets triggered, which is awesome, popstate is triggered only when I press browser history buttons. With yours I get popstate triggered while I pushState, just no! I get your approach to handle everything inside the stateChange, but it simply not possible on a collaborative/modular project, I can give you a few real world use cases if you need. One would be when your pager Ajax is handled by CMS, user clicks on a page, the CMS gets new content, you [pushState]. On [popstate] you would trigger pager click to let CMS load that page as a response to history change. Here you can't place everything inside [stateChange] and if your library triggers [popstate] immediately on [pushState] at the click of a pager link it will cause an infinite loop. Add to this that the states are not even popping in the right order and your library is done.

And on behalf of others, thanks for wasting hundreds man-hours. I could have gladly spent this time helping you improve your library, now I'm behind schedule. I'd suggest rename it to [attempted.history.js] so that people don't accidentally assume that it's a solid wrapper for the history API.

Issue 1. I think you missed that it does a replace state and not a push state for state 3 so first we  push state 1, then push state 2, then replace state which replaces state 2 with state 3 so naturally our states are now 1 -> 3 not 1 -> 2 -> 3 so going back brings you to state 1.
Issue 2. Not really sure how you get state C when you are already on it. Maybe their are multiple states that are the same.
Issue 3. The fact that it does a statechange when pushing was confusing to me at first and there are quite a few issues talking about this but an easy solution is before you do a push state set a variable to true and on statechange dont do anything if it is set and set it back to false. Be careful about pushing the same state though as pushing the same state wont trigger a statechange, you can get around this by adding some random data to the state there are issues about this as well.
I do agree that this has it quirks and can be tricky to use at times but its not nearly as bad as you make it out to be. Once you figure out how to use it you can do alot with it.


Synthesis failed for java-datalabeling

Hello! Autosynth couldn't regenerate java-datalabeling. :broken_heart:
Here's the output from running synth.py:
nOrBuilder.java.
2021-01-11 02:09:04,358 synthtool [INFO] > Replaced '// Generated by the protocol buffer compiler.  DO NOT EDIT!' in /tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/proto-google-cloud-datalabeling-v1beta1-java/src/main/java/com/google/cloud/datalabeling/v1beta1/VideoObjectTrackingAnnotationOrBuilder.java.
2021-01-11 02:09:04,358 synthtool [INFO] > Replaced '// Generated by the protocol buffer compiler.  DO NOT EDIT!' in /tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/proto-google-cloud-datalabeling-v1beta1-java/src/main/java/com/google/cloud/datalabeling/v1beta1/SearchEvaluationsRequestOrBuilder.java.
2021-01-11 02:09:04,359 synthtool [INFO] > Replaced '// Generated by the protocol buffer compiler.  DO NOT EDIT!' in /tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/proto-google-cloud-datalabeling-v1beta1-java/src/main/java/com/google/cloud/datalabeling/v1beta1/AnnotatedDatasetOrBuilder.java.
2021-01-11 02:09:04,359 synthtool [INFO] > Replaced '// Generated by the protocol buffer compiler.  DO NOT EDIT!' in /tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/proto-google-cloud-datalabeling-v1beta1-java/src/main/java/com/google/cloud/datalabeling/v1beta1/VertexOrBuilder.java.
2021-01-11 02:09:04,366 synthtool [WARNING] > No replacements made in [PosixPath('/tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/proto-google-cloud-datalabeling-v1beta1-java/src/**/*Name.java'), PosixPath('/tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/proto-google-cloud-datalabeling-v1beta1-java/src/**/*Names.java')] for pattern /\*
 \* Copyright \d{4} Google LLC
 \*
 \* Licensed under the Apache License, Version 2.0 \(the "License"\); you may not use this file except
 \* in compliance with the License. You may obtain a copy of the License at
 \*
 \* http://www.apache.org/licenses/LICENSE-2.0
 \*
 \* Unless required by applicable law or agreed to in writing, software distributed under the License
 \* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 \* or implied. See the License for the specific language governing permissions and limitations under
 \* the License.
 \*/
, maybe replacement is no longer needed?
2021-01-11 02:09:04,369 synthtool [INFO] > Replaced '^package (.*);' in /tmpfs/tmp/tmpn_2rkxu5/google-cloud-datalabeling-v1beta1-java/grpc-google-cloud-datalabeling-v1beta1-java/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceGrpc.java.
2021-01-11 02:09:04,720 synthtool [INFO] > Running java formatter on 11 files
2021-01-11 02:09:08,640 synthtool [INFO] > Running java formatter on 1 files
2021-01-11 02:09:11,642 synthtool [INFO] > Running java formatter on 284 files
2021-01-11 02:09:28,310 synthtool [DEBUG] > Using precloned repo /home/kbuilder/.cache/synthtool/synthtool
.github/CODEOWNERS
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/ISSUE_TEMPLATE/support_request.md
.github/PULL_REQUEST_TEMPLATE.md
.github/blunderbuss.yml
.github/generated-files-bot.yml
.github/readme/synth.py
.github/release-please.yml
.github/snippet-bot.yml
.github/trusted-contribution.yml
.github/workflows/approve-readme.yaml
.github/workflows/auto-release.yaml
.github/workflows/ci.yaml
.github/workflows/samples.yaml
.kokoro/build.bat
.kokoro/build.sh
.kokoro/coerce_logs.sh
.kokoro/common.cfg
.kokoro/common.sh
.kokoro/continuous/common.cfg
.kokoro/continuous/java8.cfg
.kokoro/continuous/readme.cfg
.kokoro/dependencies.sh
.kokoro/linkage-monitor.sh
.kokoro/nightly/common.cfg
.kokoro/nightly/integration.cfg
.kokoro/nightly/java11.cfg
.kokoro/nightly/java7.cfg
.kokoro/nightly/java8-osx.cfg
.kokoro/nightly/java8-win.cfg
.kokoro/nightly/java8.cfg
.kokoro/nightly/samples.cfg
.kokoro/populate-secrets.sh
.kokoro/presubmit/clirr.cfg
.kokoro/presubmit/common.cfg
.kokoro/presubmit/dependencies.cfg
.kokoro/presubmit/integration.cfg
.kokoro/presubmit/java11.cfg
.kokoro/presubmit/java7.cfg
.kokoro/presubmit/java8-osx.cfg
.kokoro/presubmit/java8-win.cfg
.kokoro/presubmit/java8.cfg
.kokoro/presubmit/linkage-monitor.cfg
.kokoro/presubmit/lint.cfg
.kokoro/presubmit/samples.cfg
.kokoro/readme.sh
.kokoro/release/bump_snapshot.cfg
.kokoro/release/common.cfg
.kokoro/release/common.sh
.kokoro/release/drop.cfg
.kokoro/release/drop.sh
.kokoro/release/promote.cfg
.kokoro/release/promote.sh
.kokoro/release/publish_javadoc.cfg
.kokoro/release/publish_javadoc.sh
.kokoro/release/snapshot.cfg
.kokoro/release/snapshot.sh
.kokoro/release/stage.cfg
.kokoro/release/stage.sh
.kokoro/trampoline.sh
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
codecov.yaml
java.header
license-checks.xml
renovate.json
samples/install-without-bom/pom.xml
samples/pom.xml
samples/snapshot/pom.xml
samples/snippets/pom.xml
2021-01-11 02:09:28,461 synthtool [DEBUG] > existing pom file found (samples/pom.xml) - keeping the existing
2021-01-11 02:09:28,462 synthtool [DEBUG] > existing pom file found (samples/snapshot/pom.xml) - keeping the existing
2021-01-11 02:09:28,463 synthtool [DEBUG] > existing pom file found (samples/snippets/pom.xml) - keeping the existing
2021-01-11 02:09:28,463 synthtool [DEBUG] > existing pom file found (samples/install-without-bom/pom.xml) - keeping the existing
2021-01-11 02:09:31,524 synthtool [DEBUG] > Wrote metadata to synth.metadata.
2021-01-11 02:09:31,605 autosynth [INFO] > Changed files:
2021-01-11 02:09:31,606 autosynth [INFO] > M synth.metadata
2021-01-11 02:09:31,606 autosynth [DEBUG] > Running: git log fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483 -1 --no-decorate --pretty=%s
2021-01-11 02:09:31,609 autosynth [DEBUG] > Running: git log fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483 -1 --no-decorate --pretty=%b%n%nSource-Author: %an <%ae>%nSource-Date: %ad
2021-01-11 02:09:31,613 autosynth [DEBUG] > Running: git add -A
2021-01-11 02:09:31,619 autosynth [DEBUG] > Running: git status --porcelain
2021-01-11 02:09:31,625 autosynth [DEBUG] > Running: git commit -m chore(python): skip docfx in main presubmit

* chore(python): skip docfx in main presubmit

* fix: properly template the repo name

Source-Author: Bu Sun Kim<EMAIL_ADDRESS>Source-Date: Fri Jan 8 10:32:13 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483
Source-Link: https://github.com/googleapis/synthtool/commit/fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483
[autosynth-69 b3a4ca9] chore(python): skip docfx in main presubmit
 1 file changed, 4 insertions(+), 4 deletions(-)
2021-01-11 02:09:31,633 autosynth [DEBUG] > Running: git reset --hard HEAD
HEAD is now at b3a4ca9 chore(python): skip docfx in main presubmit
2021-01-11 02:09:31,639 autosynth [DEBUG] > Running: git checkout autosynth
Switched to branch 'autosynth'
2021-01-11 02:09:31,645 autosynth [DEBUG] > Running: git diff HEAD..autosynth-69 -- . :(exclude)synth.metadata
2021-01-11 02:09:31,649 autosynth [DEBUG] > Running: git diff HEAD..autosynth-69 -- synth.metadata
2021-01-11 02:09:31,653 autosynth [DEBUG] > Running: git diff HEAD..autosynth-70 -- . :(exclude)synth.metadata
2021-01-11 02:09:31,661 autosynth [DEBUG] > Running: git diff HEAD autosynth-70
2021-01-11 02:09:31,670 autosynth [DEBUG] > Running: git apply /tmpfs/tmp/tmpa0j502fv/autosynth-70.patch
2021-01-11 02:09:31,674 autosynth [DEBUG] > Running: git add -A
2021-01-11 02:09:31,681 autosynth [DEBUG] > Running: git status --porcelain
2021-01-11 02:09:31,689 autosynth [DEBUG] > Running: git commit -m chore: update gapic-generator-java to 0.0.18

Committer: @miraleung
PiperOrigin-RevId: 350949863

Source-Author: Google APIs<EMAIL_ADDRESS>Source-Date: Sat Jan 9 14:01:49 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 91e206bcfeaf8948ea03fe3cb1b7616108496cd3
Source-Link: https://github.com/googleapis/googleapis/commit/91e206bcfeaf8948ea03fe3cb1b7616108496cd3
[autosynth 73de0cb] chore: update gapic-generator-java to 0.0.18
 6 files changed, 14 insertions(+), 7 deletions(-)
2021-01-11 02:09:31,705 autosynth [DEBUG] > Running: git log -1 --no-decorate --format=%B
2021-01-11 02:09:31,709 autosynth [DEBUG] > Running: git push --force origin autosynth
To https://github.com/googleapis/java-datalabeling.git
 + 250ac4b...73de0cb autosynth -> autosynth (forced update)
2021-01-11 02:09:35,530 autosynth [DEBUG] > Running: git log -1 --pretty=%b
2021-01-11 02:09:38,303 autosynth [DEBUG] > Running: git clean -fdx
Removing __pycache__/
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 354, in <module>
    main()
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 189, in main
    return _inner_main(temp_dir)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 334, in _inner_main
    commit_count = synthesize_loop(x, multiple_prs, change_pusher, synthesizer)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 92, in synthesize_loop
    synthesize_inner_loop(fork, synthesizer)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 137, in synthesize_inner_loop
    synthesizer, len(toolbox.versions) - 1
  File "/tmpfs/src/github/synthtool/autosynth/synth_toolbox.py", line 259, in synthesize_version_in_new_branch
    synthesizer.synthesize(synth_log_path, self.environ)
  File "/tmpfs/src/github/synthtool/autosynth/synthesizer.py", line 120, in synthesize
    synth_proc.check_returncode()  # Raise an exception.
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['/tmpfs/src/github/synthtool/env/bin/python3', '-m', 'synthtool', '--metadata', 'synth.metadata', 'synth.py', '--']' returned non-zero exit status 1.

Google internal developers can see the full log here.

Autosynth passed, closing! :green_heart:

Autosynth passed, closing! :green_heart:


update gnfinder to 1.12.1

No problem @harshzalavadiya, and thanks, I added PDF, MS Docs handling to gnfinder via remote Tika service now, to make it easier for people to install. I also added to its Readme a link to your version of gnfinder, in case if someone wants to find names from PDFs without having internet or local Tika service


Offline and errors pattern in Quickbooks Online integration

Details

Fixed Issues

$https://github.com/Expensify/App/issues/45406 - partially fixed
PROPOSAL:
Tests

Test errors:

Set Simulate failing network in Troubleshooting (you can set MAX_REQUEST_RETRIES to 0 to get errors faster).
Go to Settings -> Workspaces -> your QuickbooksOnline workspace -> Accounting.
Go through every page and try changing values.
See that there are RBRs and error messages when request fails.

[x] Verify that no errors appear in the JS console

Offline tests

Go to Settings -> Workspaces -> your QuickbooksOnline workspace -> Accounting.
Go through every page and try changing values.
See that changed values are on opacity 50%.

QA Steps
Test errors:

Set Simulate failing network in Troubleshooting (you can set MAX_REQUEST_RETRIES to 0 to get errors faster).
Go to Settings -> Workspaces -> your QuickbooksOnline workspace -> Accounting.
Go through every page and try changing values.
See that there are RBRs and error messages when request fails.

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[x] I verified that all the inputs inside a form are aligned with each other.
[x] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
#### Offline
https://github.com/user-attachments/assets/8bf46e3d-8f15-4a88-a2cf-592bd7ac8df2
Errors
https://github.com/user-attachments/assets/30827af8-c37c-4ea2-8eda-1f5df542d61b

Android: mWeb Chrome
Offline
https://github.com/user-attachments/assets/8f42ead4-5d8e-4dff-9f53-0784696382e5
Errors
https://github.com/user-attachments/assets/e059a71d-f8b1-480a-a21d-0d395ccfd7a3

iOS: Native
Offline
https://github.com/user-attachments/assets/4f63bdc3-46f7-4884-ac3a-4e6ae1d31213
Errors
https://github.com/user-attachments/assets/3b90e064-664b-4a41-95a1-d2dc20207e16

iOS: mWeb Safari
Offline
https://github.com/user-attachments/assets/488dcd24-625a-4208-a918-0f94caba1dbd
Errors
https://github.com/user-attachments/assets/b9b9cd83-0ae5-4477-b87d-a34c1a8f35ba

MacOS: Chrome / Safari
Offline
https://github.com/user-attachments/assets/a1ac7659-0b11-4a0a-9f7a-98b500035710
Errors
https://github.com/user-attachments/assets/b3cc8bac-d4cc-45c5-89fe-17b6958eff5d

MacOS: Desktop
#### Offline
https://github.com/user-attachments/assets/beeb1c13-53bc-4be2-8208-28f6dda6febb
Errors
https://github.com/user-attachments/assets/82a0c6c7-26c1-4192-a672-2b4b1be209e8

hi @kirillzyusko, since the new React Compiler check was introduced, the flow is failing for me with components that my PR hasn't touched at all.
Could you take a look? 😊

Hey @zfurtak
Which errors QuickbooksOutOfPocketExpenseConfigurationPage.tsx file throws? If it's only React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved then it could because of the fact that you've changed useMemo code - maybe it happens because we duplicate dependency and re-use the same expression inside useMemo (maybe worth to create a separate variable and re-use it).
I believe if you run npm run react-compiler-healthcheck then it should print all files with all problematic code and line numbers. Can you go through all these errors and figure out which code causes problems and try to re-work it so that compiler doesn't complain anymore?

I believe if you run npm run react-compiler-healthcheck then it should print all files with all problematic code and line numbers. Can you go through all these errors and figure out which code causes problems and try to re-work it so that compiler doesn't complain anymore?

This is exactly what I did, here is the output I got:

...QuickbooksAdvancedPage.tsx Reason: Invalid nesting in program blocks or scopes
...QuickbooksExportConfigurationPage.tsx:97:111. Reason: Unexpected terminal kind optional for ternary test block
...QuickbooksExportDateSelectPage.tsx:36:8. Reason: React Compiler has skipped optimizing this component because the existing manual ...
...QuickbooksOutOfPocketExpenseConfigurationPage.tsx Reason: Invalid nesting in program blocks or scopes

At this point I don't know how to solve them 🧐

@zfurtak I sent you patches in Slack with fixes. And I also updated REACT_COMPILER.md file in https://github.com/Expensify/App/pull/47161 where reflected your problems and way to fix it 👍

Reviewer Checklist

[ ] I have verified the author checklist is complete (all boxes are checked off).
[ ] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[ ] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[ ] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] Android: Native
[ ] Android: mWeb Chrome
[ ] iOS: Native
[ ] iOS: mWeb Safari
[ ] MacOS: Chrome / Safari
[ ] MacOS: Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[ ] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[ ] I verified that comments were added to code that is not self explanatory
[ ] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[ ] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[ ] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[ ] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[ ] If any new file was added I verified that:

[ ] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn't already exist
[ ] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)

[ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[ ] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[ ] I verified that all the inputs inside a form are aligned with each other.
[ ] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[ ] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[ ] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

@zfurtak ✅ Completed the PR Reviewer Checklist, PR tests well and there are no functionality issues. However, Imfound some UI behaviour related to errors and offline which I want to double check with the design team before approving.
1. "Accounting > Export > Export company card expenses as" error appears at the bottom of empty Bank account page after changing Export as when API call failed

Videos PR vs Staging

PR
Staging

2. "Accounting > Export > Export company card expenses as" empty Bank account page is grayed-out after changing Export as while offline

Videos PR vs Staging

PR
Staging

These are the two discrepancies I noticed while testing (when compared to current staging) which I want to confirm with @Expensify/design that we're 🟢 before moving on, please let me know!

For the 1st point, the PR version seem to be a lot cleaner to me, but I'm not sure if it's the right way to handle it. Keen to hear what @shawnborton and @dannymcclain thinks here.
On the 2nd point there should be a "You appear to be offline" indicator also in the right hand panel which doesn't seem to be the case. And if I understood the discrepancy correctly, then is it that the error is showing on the main page?

And if I understood the discrepancy correctly, then is it that the error is showing on the main page?

@dubielzyk-expensify The diff from this PR vs Staging is that the empty RHP page design is grayed-out on this PR if the field above is changed while offline, which is not the case on current staging when doing the same thing.

The diff from this PR vs Staging is that the empty RHP page design is grayed-out on this PR if the field above is changed while offline, which is not the case on current staging when doing the same thing.

Do you know why it's grayed out? We use the 50% opacity pattern for pending creation items. It feels like the empty state wouldn't qualify as something that is pending creation, right?
I agree with Jon though that I think an offline indicator would show in the RHP for point 2 above.
For point 1, I don't feel too strongly there about the error message being in the empty state - do you know why that was added though?

We use the 50% opacity pattern for pending creation items. It feels like the empty state wouldn't qualify as something that is pending creation, right?
I agree with Jon though that I think an offline indicator would show in the RHP for point 2 above.

Yeah I agree here. Also not sure why the empty state would be 50% opacity in this situation.
And then for point 1. I think I'm with Jon. The PR version feels cleaner, but I do think it's pretty weird to put an error message on that empty state screen... So I guess I don't have super strong feelings about this one.

Hi guys 😊

"Accounting > Export > Export company card expenses as" error appears at the bottom of empty Bank account page after changing Export as when API call failed

About the first point, the error is there, because changing Export as value is trying to change Bank account value, which fails.
We could think of removing the error completely when screen is empty or maybe putting the error above the empty indicator? 🤔
And about the second issue:

"Accounting > Export > Export company card expenses as" empty Bank account page is grayed-out after changing Export as while offline

I believe the grayed-out empty page wasn't intentional 😅

We could think of removing the error completely when screen is empty or maybe putting the error above the empty indicator? 🤔

I don't feel too strongly here but looking at this again, why are we showing a generic "Oops..." error here instead of something that actually has instructions for how to fix the issue that caused the error in the first place?

About the first point, the error is there, because changing Export as value is trying to change Bank account value, which fails.

Am I right in thinking we can't retrieve the appropriate list of accounts when the export method is changed while offline? I.e if I had Vendor bill selected we'd see a list of Accounts payable accounts. If I change that to Debit card export offline, we can't retrieve the list of Bank accounts to select, so it's an empty list. Is that the problem?
If so, I wonder if that conditional push input should push to a page that has the full page "You appear to be offline" cloud guy illustration for this case?

About the second point (offline)
So far I've changed the grey empty list component, but it was with opacity 50% because when we change the value of Export as, we also change the value of the account, sometimes it changes to an empty list and then we see the component.
However I discovered a problem related  to this part (video below). 🤔
The title should be Not configured but the value of reimbursableExpensesAccount.name (from QBO config) remains from the previous option, as we pass  undefined to onyx. I tried to change it in the code to clear the value with null but the backend doesn't allow it. Could you consider this as a possible issue?
https://github.com/user-attachments/assets/dbe0a9dd-cc75-4a74-94b8-213f178c135d

@deetergp We use the UpdateManyPolicyConnectionConfigurations command here and we want to set nonReimbursableExpensesAccount field to null (or some other value that tells us it's empty).
Now it's done this way
[CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts[0],

but if the row.accounts is empty we get undefined and send nothing to the backend.
We tried to pass null when the row.accounts[0] is undefined but the backend returned an error:

That's why we think this issue is BE related but maybe there is a way of clearing the value. Any help would be appreciated 🙏

hi @deetergp, could you take a look at this issue? 😊

@deetergp
Can we get on with this issue? because it's been in progress for quite a long time so far 😊

My apologies @zfurtak, I will investigate those BE changes today.

Hello @deetergp, how is it going? 😃

@zfurtak @war-in Can you give me the policyID for the workspace you are testing with? I found the block where we are throwing it (link, for future me's benefit) but I want to see what's currently stored in the DB for that property. Thanks!

@deetergp sure thing!
Here's the ID of my policy that is connected to QBO: A99CBAAB0B1E1AB3

Hi @deetergp, at the moment the code that connects back and front is being changed, maybe this refactor will fix the problem at the same time. 🤔.
However this bug had existed before this refactor, so I think it could be good to leave it as it is for now and merge this PR as it's been waiting enough already.
What do you think? 😊
cc: @war-in

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

🚀 Deployed to staging by https://github.com/deetergp in version: 9.0.30-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


If feature flags are the only filters then all keys are requested

If the only key-value filters specified start with .appconfig.featureflag/ then the client requests key=*.
For example, this will display all configuration keys, including all flags:
var config = new ConfigurationBuilder().AddAzureAppConfiguration(options =>
{
    options.Connect("...");
    options.UseFeatureFlags(options => options.Select("flag1,.appconfig.featureflag/flag2")); // side note, csv is weird here
}).Build();
Console.WriteLine(config.GetDebugView());

The only way I have found to prevent this is to put a dummy filter key in e.g.
var config = new ConfigurationBuilder().AddAzureAppConfiguration(options =>
{
    options.Connect("...")
        .Select("DOESNOTEXIST", LabelFilter.Null);
    options.UseFeatureFlags(options => options.Select("flag1,.appconfig.featureflag/flag2"));
}).Build();
Console.WriteLine(config.GetDebugView());

This is caused by the default query logic defined in AzureAppConfigurationProvider.LoadSelectedKeyValues
I assume this was done so that adding feature flags to something that previously had no filters should not prevent it from reading what it already had, but it makes filtering which feature flags are read difficult.
It all still works, it's just making more requests than expected to AAC, which causes performance/throttling issues.

Hi @ghelyar, at the moment we still recommend using a dummy key filter like .Select("_") to prevent the default query. Are you saying that you've noticed performance/throttling issues even when using this solution? I wouldn't expect this select call to have a noticeable effect on an application.

No I haven't had throttling since implementing this, but I did not find it very clear that this needed doing at all.
I only did this because I got unexpected throttling which caused some problems in production, then turned on EventSource tracing and noticed the excessive requests it was making, then looked thought the source to find why it was requesting everything even after I specifically told it to filter.
Also .Select("flag1").Select("flag2") causes it to make multiple requests, which I was not expecting, hence the CSV in the code above, but because it prefixes the first flag, CSV filtering needs to add the prefix between each subsequent flag only.
It's all just a bit counterintuitive, and doesn't seem to do what you ask it to do unless you really dig into the implementation to get a deep understanding of how it works so that you can work around all the quirks.

I understand, we didn't make it clear that key-values would be selected by default in at least some of the documentation, so it's a valid concern. That's something I would consider at least adding to the method summary in the code.
As far as selecting multiple flags, I'll look into how we could make the usage of FeatureFlagOptions.Select with commas clearer and if we can remove the prefix on each subsequent flag name. You can also use a prefix like NumberedFlags:* to select multiple flags with one call to Select to make things a bit cleaner if that's possible for your scenario.
Currently, this dummy filter workaround has only been mentioned here as far as I'm aware.
I'll make sure to update this thread and link any related pull requests made as a result of this. I hope that answers your questions, let me know if there's anything else we should address.

One possible implementation of the select could be to take a params array, gather the filters and Chunk(5) and string.Join them into CSV format to reduce requests, but it doesn't really help when it's also requesting *.
You could change StartsWith(".appconfig.featureflag/") to Equals(".appconfig.featureflag/*") so that if you specify any filter then it doesn't request * but that means that if you specify a feature flag filter and it no normal configuration filters, it also excludes them, which is also unexpected.
Really it's just that the API implies that there are two independent filter sets but in reality there is only one.
I can't just flag name prefix in my particular case, because flags can be used across multiple services so the name can't include the service name, I can't use labels because we're using labels for environmental overrides. As far as I can tell AAC is designed for you to have one AAC for each service but this is quite a big a maintenance burden for systems with many services and environments, and the whole point of us using this was supposed to be a single central source of truth.


add error when wrong schema is uploaded

show error during validation when columns don't match the new schema (e.g. upload an old schema)

Looks like this works! We can test more with other users, but we can close for now.


IsMemberImplemented check only targets explicit method implementation

Publicly implemented interface member is being ignored because of  targeting MethodKind.ExplicitInterfaceImplementation
Also, what was the original intention for interfaces being implemented only explicitly?

There is more than one view/expectation how "AutoInterface" mechanism should work. In other words, real question is what AutoInterface should solve.
It is not hard to add few extra options and change default behavior but one need to be aware of them.
For me this project is exploration in the domain of language design. I view AutoInterface as mechanism (i.e. missing language feature) that introduces a form of composition-over-inheritance in halfway between composition and inheritance. I wanted hands-on project to try it whether is it usable as such or it introduces too much trouble.
Here is figurative/synthetic example that led me to the current solution:
interface IScoreAccount
{
   void Update();
}

interface IPlayerDrawable
{
   void Update();
}

class OurClass
{
   [Marker]
   IScoreAccount aspect1 = obj1;

   [Marker]
   IPlayerDrawable aspect2 = obj2;
}

OurClass is composed of two aspects and it also behaves as IScoreAccount and IPlayerDrawable... just as following:
class OurClass
{
   public IScoreAccount Aspect1 {get;}
   public IPlayerDrawable Aspect2 {get;}
}

but users do not have to manually dereference myclass.Aspect1.Update()
Here comes hard part..
Interfaces can have members with a same name.. In our example Update() should not be the same because we compose different aspects, but in some other context we can have property like int Count {get;} where interface members and public interface member should be the same.

In the case of method Update(): public method Update() may exist and it does not have to relate to method from either interface. Customization is not possible without explicit interface members. Interference between public members and interfaces is unwanted.
In the case of property int Count {get;}: thinking about explicit-interface is too much to ask

Choosing one somehow excludes the other. Actually I was aware of that problem but decided to make more general solution and see how it unfolds.
As I understood, you favors case 2 to be default and if one needs to customize then he/she needs to opt-in
For example:
interface ITest
{
   int Count {get;}
}
class SomeCollection : ITest
{
   [Marker]
   private ITest aspect1 = obj;

   //public int Count => 1; uncomment this line to prevent autogeneration if public interface is preferred
   //int ITest.Count => this.Count; uncomment this line to prevent autogeneration if explicit interface is preferred
}

class OurClass
{
   //here we opt-in for more general case where public member
   //is being ignored and explicit interface member is the only option
   //default is opted-out, now it the only option
   [Marker(PleaseForwardEverything)]
   IScoreAccount aspect1 = obj1;

   [Marker(PleaseForwardEverything)]
   IPlayerDrawable aspect2 = obj1;
}

What do you think?

Now I see how general explicit implementation is. The simple thing is I haven't met or considered the situations of composing more than one aspects. So being comfortable implementing interfaces publicly, I wasn't aware of no relation between these cases.
My problem with explicit implementation could be easily solved on my side, as I faced some problems with reflection.
Given the wide hierarchy of interfaces i need to provide additional behavior which could be related to some interface method calls. So I came out with simple wrapper class, where some members are decorated and others are just forwarded. As interface hierarchy is complex, I had to forward 15+ members or something. I thought, it would be convenient to have a language feature like delegate pattern in Kotlin. With pretty short research of existing source generators, I ended up here, expecting the same simple thing.
As for your example, I can't imagine right now, how to combine public and explicit implementations without directly marking them in the attribute declaration. Maybe, it would be better to stay on explicit solution, as it's general one.

Now I see that name AutoInterface is not well 'selected'. Here we have code reusability through:

composition - wants aspects to be untangled
delegation - everything is in public interface

I've changed Kotlin sample from your link to get colliding names as follows:
interface Base1 {
    val message: String
    fun print()
}

interface Base2 {
    val message: String
    fun print()
}

class Base1Impl(val x: Int) : Base1 {
    override val message = "Base1Impl: x = $x"
    override fun print() { println(message) }
}

class Base2Impl(val x: Int) : Base2 {
    override val message = "Base2Impl: x = $x"
    override fun print() { println(message) }
}

class Derived(b1: Base1, b2: Base2) : Base1 by b1, Base2 by b2 {
    override val message = "Message of Derived"
}

fun main() {
    val b1 = Base1Impl(10)
    val b2 = Base2Impl(10)
    val derived = Derived(b1, b2)
    derived.print()
    println(derived.message)
}

and it produced following error:
Class 'Derived' must override public open fun print(): Unit defined in Derived because it inherits many implementations of it

In other words, if things collide on public side you should think about it..
AutoInterface is equipped with templating by which you could hack things per class-member but in my opinion that should be used only in case of extreme desperation.
My proposal to cover everything we talked so far (and to communicate properly to users) would be to abandon AutoInterfaceAttribute and introduce new attribute for each use-case:

TraitAttribute - it would forward calls from perspective of specific aspect
DelegatedAsAttribute - it would implement all members as public members and forward calls to a backing object. Name collision would generate compile error if resulting set of backing objects have more than one element. That would cover majority of cases like inherited interfaces etc..

Names of both attributes are problematic; here are some variations:
PublishInterfaceAttribute, AutoComposeAttribute, ForwardCallsToAttribute
AutoDelegateAttribute, AutoImplementAttribute, DelegatedInterfaceAttribute
Also, can we make some useful interaction between AutoInterface source generation and user's reflection (as I understood, you call some members through reflection)?

This is all very interesting... I think it would be worthwhile to have separate attributes (or an enum option to pass into the attribute-ctor) to determine between public class members, protected class members and explicit interface implementations for the delegation calls

Sorry for being silent for a long time. I've found a different way to solve my exact problem, using AOT. I think this source generator should remain as it is.


Support team reviewers

What's the suggestion?
At the moment, the workflow only supports reviewers as opposed to team reviewers. This should be added!

Would be great to have this feature sometime!!

Just stumbled across this action and it would be a game changer if this was implemented.
I've researched the octokit js library and seems like there is a build-in way to request teams using the official API.


[Bug]Cannot remove a WebglOverlay

Description
When I'm changing places list that is passed down to the Map as a array for map of MapMarker i'm getting error
Cannot remove a WebglOverlay that has not been set to a map

Code that I'm using is the same as it was in: https://github.com/visgl/react-google-maps/discussions/325#discussion-6563222. Im just changing places, so it is triggering re-render of Map.
I'm also doing some calculations to center the map when places are changed or map is loaded:
const handleSetBounds = (): void => {
  if (!map) return;

  map.fitBounds(getMapBounds(window.google.maps, places));

  if (places.length < 2 && places.length > 0) {
    map.fitBounds(getMapBounds(window.google.maps, places));
    map.setZoom(14);
  } else if (places.length === 0) {
    map.setZoom(0);
    map.fitBounds(polandBounds);
  }
};

useEffect(() => {
  if (!map) return;
  handleSetBounds();

  // eslint-disable-next-line react-hooks/exhaustive-deps
}, [map, places]);

Steps to Reproduce
Change variable that is used to map thought map markers
Environment

Library version<EMAIL_ADDRESS>"^0.10.0",
Google maps version: weekly
Browser and Version:  124.0.6367.118
OS: Linux

Logs
Cannot remove a WebglOverlay that has not been set to a map
    at eval (webpack-internal:///./node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs:1081:5)
    at GoogleMapsMarker (webpack-internal:///./ui/google-maps/GoogleMapsMarker.tsx:23:11)
    at div
    at Map (webpack-internal:///./node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs:783:5)
    at div
    at eval (webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-43c6fea0.browser.esm.js:60:66)
    at Box (webpack-internal:///./node_modules/@mui/system/esm/createBox.js:37:72)
    at eval (webpack-internal:///./node_modules/@emotion/react/dist/emotion-element-43c6fea0.browser.esm.js:60:66)
overrideMethod @ console.js:273
a @ js?key=XXX&solution_channel=GMP_VISGL_react&loading=async&callback=__googleMapsCallback__:348
_.kn.map_changed @ js?key=XXX&solution_channel=GMP_VISGL_react&loading=async&callback=__googleMapsCallback__:348
Uk @ js?key=XXX&solution_channel=GMP_VISGL_react&loading=async&callback=__googleMapsCallback__:155
_.Sk.set @ js?key=XXX&solution_channel=GMP_VISGL_react&loading=async&callback=__googleMapsCallback__:274
(anonymous) @ js?key=XXX&solution_channel=GMP_VISGL_react&loading=async&callback=__googleMapsCallback__:163
dispose @ marker.js:103
KMa @ marker.js:60
dispose @ marker.js:129
setMap @ marker.js:122
set map @ marker.js:121
eval @ index.modern.mjs:1012
safelyCallDestroy @ react-dom.development.js:22932
commitHookEffectListUnmount @ react-dom.development.js:23100
commitPassiveUnmountInsideDeletedTreeOnFiber @ react-dom.development.js:25098
commitPassiveUnmountEffectsInsideOfDeletedTree_begin @ react-dom.development.js:25048
commitPassiveUnmountEffects_begin @ react-dom.development.js:24956
commitPassiveUnmountEffects @ react-dom.development.js:24941
flushPassiveEffectsImpl @ react-dom.development.js:27038
flushPassiveEffects @ react-dom.development.js:26984
commitRootImpl @ react-dom.development.js:26935
commitRoot @ react-dom.development.js:26682
performSyncWorkOnRoot @ react-dom.development.js:26117
flushSyncCallbacks @ react-dom.development.js:12042
eval @ react-dom.development.js:25651
Show 1 more frame
Show less

Issue same with following:

#419

Closing this since it's a duplicate of #419.
We are aware this is happening occasionally, and it's clearly related to unmounting an AdvancedMarker component. It's also clear that it's "just" a warning message (annoying, true, but I haven't yet seen any consequence besides that warning in the console).
I already spent considerable time trying to figure out why exactly this is happening so we know how to prevent it.
Without a clear example that reliably reproduces this, it's quite difficult.

See also: https://issuetracker.google.com/issues/356878392


Header Documentation, Responsive Mode, Merge Conflicts and changes in Home Page

Fix #554

@smaranjitghose Kindly check


Pawn mood bug

Steps to produce...

Create a pawn with no mood/joy/comfort etc (eg. with a gene)
Give pawn might trait (using item)
Give pawn might class (using item) eg. Monk, but I think the issue should occur with every class

What should happen...
Pawn gets a chi bar, no console errors, can meditate, etc
What actually happens...
Pawn doesnt get a chi bar, lots of console errors, meditating does nothing.
This is one of the errors...
Exception ticking Burban (at (217, 0, 167)): System.NullReferenceException: Object reference not set to an instance of an object
[Ref 741149BA]
 at TorannMagic.CompAbilityUserMight.ResolveSustainedSkills () [0x008c5] in <fb59b96a7c5c447ea5217e8dbd7643c1>:0
 at TorannMagic.CompAbilityUserMight.CompTick () [0x001a3] in <fb59b96a7c5c447ea5217e8dbd7643c1>:0
 at Verse.ThingWithComps.Tick () [0x00024] in <2a40c3593b334f29ac3cb3d32d652351>:0
 at Verse.Pawn.Tick () [0x0002c] in <2a40c3593b334f29ac3cb3d32d652351>:0
     - POSTFIX Mlie.YayosCombat3: Void yayoCombat.HarmonyPatches.Pawn_TickRare:Postfix(Pawn __instance)
 at Verse.TickList.Tick () [0x0015c] in <2a40c3593b334f29ac3cb3d32d652351>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
Verse.TickList:Tick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch3 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Game.UpdatePlay_Patch4 (Verse.Game)
Verse.Root_Play:Update ()

I believe the errors are occurring because the code isn't checking if the pawn has a mood before going deeper or making adjustments to mood.
For example here...
if(this.Pawn.needs.mood.thoughts.memories.NumMemoriesOfDef(ThoughtDef.Named("RangerSoldBondedPet")) > 0)
Should probably be...
if(this.Pawn.needs?.mood?.thoughts.memories.NumMemoriesOfDef(ThoughtDef.Named("RangerSoldBondedPet")) > 0)
I think there are other situations too, for example in skills like Meditate, it makes a lot of assumptions that needs/mood exists.
This is the gene I used to create the pawn, which has nothing custom just disabling needs...
<GeneDef>
	<defName>ES_Gene_Emotionless</defName>
	emotionless
	<description>This individual cannot feel emotions.</description>
	<iconPath>UI/Genes/ES_Moodless</iconPath>
	<displayCategory>Miscellaneous</displayCategory>
	<biostatMet>-2</biostatMet>
	<biostatCpx>1</biostatCpx>
	<disablesNeeds>

Mood

Joy

Beauty

Outdoors

Indoors

RoomSize

Comfort

DrugDesire

	</disablesNeeds>
	<exclusionTags>

Mood_Depressive

Mood_Pessimist

Mood_Optimist

Mood_Sanguine

Aggression_DeadCalm

Aggression_Aggressive

Aggression_HyperAggressive

	</exclusionTags>
</GeneDef>

If there was more checking, then mod compatibility would likely improve a lot.

I've made a PR #82
I have made a test, and a pawn without needs/mood is able to become a Monk now. Chi hediff is added, meditation is working, and no bugs in the console.
I think there might be other unresolved errors as some checks weren't covered (eg. when assigning a moods value to a variable), but it's fixed my main issues and hopefully helps others too.

It's possible that the moodless gene can introduce some null fields so I'll add a check in the next update.