Include a cross platform sleep function in sokol_time.h

I suggest to implement a cross platform sleep function in sokol_time.h. My motivation is that in some games we have to limit the max frame rate to fixed values like 24, 120 (vsync disabled). This usually need a sleep function with milliseconds precision.
This is a possible implementation:

#ifdef WIN32
#include <windows.h>
#elif _POSIX_C_SOURCE >= 199309L
#include <time.h>
#else
#include <unistd.h>
#endif

SOKOL_TIME_API_DECL void stm_sleep(uint64_t ms);

void stm_sleep(uint64_t ms){
#ifdef WIN32
  Sleep(ms);
#elif _POSIX_C_SOURCE >= 199309L
  struct timespec ts;
  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&ts, NULL);
#else
  if(ms >= 1000) {
    sleep(ms / 1000);
  }
  usleep((ms % 1000) * 1000);
#endif
}

This is what I usually use at the moment, although this is not complete, because it doesn't handle Emscripten and possible other platforms, but it's a start. Another solution to the problem could be sokol_app.h having a target FPS option, and this would be built there, but this should take more effort to make in the library, plus less flexible in case the user is not using sokol_app.h or have unusual FPS limit requirements.
Why add this in Sokol?
One strong appeals from Sokol for me is that I usually don't have to handle different platforms using ifdefs to build applications. So for me makes sense to support this, at the moment this is the only platform related ifdef in my sokol code base.

IFIR I was considering this, but wasn't sure if sokol_time.h would be the right place, since technically sokol_time.h is only about time measurement. But I guess it makes sense, because intuitively sleeping is time related.

PS: AFAIK sleeping on HTML5 isn't possible and wouldn't be useful anyway because requestAnimationFrame() is always throttled by the display refresh rate. But IMHO it's not a problem to implement stm_sleep() as no-op on some platforms as long as it's documented.

PS: AFAIK sleeping on HTML5 isn't possible (without using async/await) and wouldn't be useful anyway because requestAnimationFrame() is always throttled by the display refresh rate. But IMHO it's not a problem to implement stm_sleep() as no-op on some platforms as long as it's documented.

On that, I wish sokol app was flexible enough to work in Emscritpten with ASINCIFY enabled, my motivation is to use stackful coroutines in C code, and ASINCIFY allows me that (via the project minicoro), plus would allow this sleep. I like to use coroutines in C, as some other game developers, because permits to do cutscenes and other game logic without spaghetti callbacks or complicated state handlers.

However, sleeping in the frame-loop will be a problem when sokol_app.h is used once multiwindow support has landed, because sleeping in one window will also stop processing of other windows (e.g. if you sleep for 16 milliseconds in each window's frame callback, and there are 10 windows open, all windows will stutter with 160 milliseconds per frame because the frame callbacks are called sequentially).

In that case the user would be responsible for sleeping once in just one window, but I find this an edge case, most people use Sokol with one window at the time. Maybe proper way to handle multiple windows would need some "target fps" per window, but that is a way more complicated road than just having this naive sleep function.

Emscripten with ASINCIFY enabled (maybe it already is?

Hmm no, I haven't tested it, but I think it should either be frame-callback without ASYNCIFY, or user-controlled frame-loop with ASYNCIFY (e.g. a different application programming model).
That would be "another" sokol_app.h though. A "user-owned" frame-loop is surprisingly difficult to implement on anything but Windows and Linux (e.g. see the macOS code in GLFW).
I also don't know how ASYNCIFY would interact with requestAnimationLoop() on the web platform, this might be like opening a can of worms ;)

I don't know tbh, the Win32 Sleep() function claims to have millisecond precision, but there are a lot of caveats in the Remarks section.
https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-sleep
Personally I never use sleep functions to wait for a specific duration since that will almost always be too jittery for game applications. What sometimes makes sense though is to call Sleep(0) to give up the current time slice.

Do you just spin?

Do you just spin?

No I simply let the vsync drive the frame pacing via the sokol_app.h frame callback. The details are slightly different per platform, some platforms have the concept of a frame callback (e.g. on macOS/iOS via MTKView, on the web via requestAnimationFrame(), and on Windows and Linux the 'presentation function' blocks until vsync.

PS: what's important for frame pacing is that there's no way to measure an exact frame duration on modern operating systems since they all have some jitter for when exactly the per frame code within a frame is called (and the same is true when a thread is woken up after a sleep). IME this jitter can be somewhere between 0.1 to 2 milliseconds. Some swapchain implementations (like DXGI or Metals CVDisplayLink) offer a slightly more precise 'presentation timestamp', but even this has considerable jitter. Also on the web platform, some browsers are still clamping time source precision to full milliseconds (fallout from Spectre/Meltdown in 2018).
This timing jitter is then the main culprit for 'microstutter'. In sokol_app.h I'm trying to filter out the jitter wither a somewhat crude by averaging the frame duration of multiple frames which works pretty well (a better approach would be to query the display refresh rate, but not all platforms support that feature).


Update KUBECONFIG unset to echo into .bash_profile instead of .profile

Using .profile to unset the KUBECONFIG env var isn't working:
[vagrant@hostname ~]$ cat .profile
unset KUBECONFIG
[vagrant@hostname ~]$ bash -l
[vagrant@hostname ~]$ kubectl get nodes
error: error loading config file "/etc/kubernetes/admin.conf": open /etc/kubernetes/admin.conf: permission denied

but adding it to .bash_profile instead does work:
[vagrant@hostname ~]$ cat .bash_profile | grep KUBECONFIG
unset KUBECONFIG
[vagrant@hostname ~]$ bash -l
[vagrant@hostname ~]$ kubectl get nodes
NAME                                      STATUS   ROLES    AGE    VERSION
nodename   Ready    master   100m   v1.19.3

kURL seems to also try to set the permissions of /etc/kubernetes/admin.conf but that's not working:
[vagrant@ip-10-0-2-15 ~]$ ll /etc/kubernetes/admin.conf
-r--r-----. 1 root root 5565 Mar 12 15:07 /etc/kubernetes/admin.conf
[vagrant@ip-10-0-2-15 ~]$ id vagrant
uid=1000(vagrant) gid=1000(vagrant) groups=1000(vagrant)

Updating this output should help reduce issues with the customer being able to use kubectl after install.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

since this is printed we don't really have to handle the zsh etc scenarios - the rare person using zsh will know to change things :)

@laverya I wondered if it should also say like "For bash, xxxxxxxxxx. If you use a different shell then see your shell's documentation for how to unset environment variables when you log in". Are other shells besides bash actually supported though?

Shells besides bash aren't officially supported, really. So no need to do that. (I see no reason why they wouldn't work, but we aren't currently taking steps to support them)


Issue#113

added weekly visit report and monthly visit report

@pedro-walter could you review this.

@vincentdavis I can review it tomorrow

@pedro-walter
is this possible to check this pull request? please merge this is everything is OK. thanks


Proxy subscripts

Abstract
Allows multiple proxies to be created for the same target host:port so parallel tests can test different toxics on the same container at the same time.
Rationale
Toxiproxy itself allows proxies to be assigned arbitrary names, but ToxiproxyContainer simplifies this a bit by auto-generating the names in the form host:port. This allows you to do getProxy multiple times for the same host:port and get back the same proxy. Handy.
To maintain this functionality, I added getProxy variants that allow you to supply a so-called "subscript". Then, the auto-generated name takes the form host:port:subscript. This way, you can have mutliple proxies for the same host:port but also don't need to manage name strings, or worry about having two proxies with the same name.
Use case
For my use, in unit tests, I intend to use a counter as the subscript, giving each test class its own separate proxy, so that toxics in one class won't affect the others, allowing the classes to run in parallel.

Sorry, rookie mistake.
(I hadn't run spotless because prettier requires NPM which I don't have installed. I tried to just "be careful" instead but failed. 😛 )

In my latest commit, spotless sames to have changed all the line endings. 😠
Let me see if I can fix that.

Ok, after installing node.js and downgrading to Java 8, I'm able to run Spotless. It still messed up the line endings, but I've manually put them back. It's failing spotlessCheck on my laptop but I'll push it up and see if it passes in CircleCI. 🤷

Alrighty @kiview - looks like I'm good to go.

Woah, hardcore environment 😅
And sorry about the dependency on NPM, we tried a couple of Gradle plugins to install it locally on demand, but they were not really cross-platform compatible.
Rebasing is not necessary, we squash commits on merge anyway 🙂

Huh. Could the red X have been caused by me?
org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=redis:3.0.2, imagePullPolicy=DefaultPullPolicy(),

Unlikely, I triggered a re-run fo the failed jobs.

Hmm, I wonder if I should have used a synchronizedMap instead of ConcurrentHashMap? In case of a race condition, we probably don't want to ask Toxiproxy for two proxies with the same name. 🤔

@prdoyle This is a good point, also think about how suitable for parallelization the implementation is. However, for our use case, I don't think the different semantics of ConcurrentHashMap and synchronizedMap() would have an effect, since we don't need a lock on the whole map object, or?

@kiview - ConcurrentMap.computeIfAbsent can execute the given mapping function multiple times. It only guarantees that it will insert the result as if by putIfAbsent.
The difference would be:

ConcurrentHashMap could call Toxiproxy multiple times to make multiple proxies with the same name. I haven't yet checked what Toxiproxy does in this situation. Ideally it would ignore the redundant requests.
synchronizedMap would ensure that this class makes only one request to Toxiproxy at a time; others would block and wait.

The latter seems safer semantically, but it does make threads block.
If Toxiproxy's POST is idempotent, we're good. Otherwise, if we're using ConcurrentHashMap then we'll need to consider what happens if multiple threads try to make the same proxy at the same time.

Toxiproxy is a little light on documentation, but I tried an experiment that has me convinced ConcurrentHashMap is ok.
I tried changing computeIfAbsent to put. This caused my tests to call the proxy POST endpoint multiple times with the same name and host:port. The tests worked. I believe this indicates that Toxiproxy is idempotent.

Thanks for looking into it. Since the operations on the map should never be performance-critical across its use cases, synchronizedMap should also be fine. Still, given the indication of idempotence of Toxiproxy, I'm okay to keep it like this. Your call 🙂

Thanks @kiview, totally agree. I'm on the fence. Blocking does introduce raise the specter of deadlock, so if it's not required, I think I might lean 51% toward leaving it with ConcurrentHashMap.

@bsideup - no, I didn't consider that. I'm fairly new to Toxiproxy. I can try it today and see how that feels.
I would say I don't think it's that unusual or advanced for people to want to run their tests in parallel though.

(For the record, I totally agree with @bsideup that those are the right questions to ask.)

I never quite figured out a clean way to do this just using the client directly. I can take another stab at it if you all still feel that's a worthwhile thing to try.

it's quite similar with what was suggested here
JFTR, proprosals by @prdoyle

Expose some of the guts of of getProxy so the user can directly create proxies using the client inside ToxiproxyContainer
Allocate my own ToxiproxyClient for the ToxiproxyContainer, manage my own port numbers and proxy names. Basically take full control myself and try not to interfere with ToxiproxyContainer's own port numbers or proxy names
Make my own  container, not using ToxiproxyContainer, and use ToxiproxyClient directly on that

and my replied

I have been thinking about option two but since have never used toxiproxy need to tries and solve some doubts taking into account the client.reset(). Please take into account that it shouldn’t be testcontainers toxiproxy module responsibility about providing such helpers around the client as we have it right now. I think that’s the main reason why we can not find a clean solution. TC toxiproxy should be responsible for helping start the container and handle different scenarios around it like in kafka or pulsar for example but shouldn’t be attached to offering a toxiproxy client per se. I think that so far we can think on deprecating some methods, extend documentation and provide a simple way to create toxiproxy clients

Yeah that makes sense. Should we close this PR?

@prdoyle glad to hear it! Do you think is worth to document it somewhere? We can discuss it via slack.


How move chart, edit chart, remove chart buttons are added on every chart of react?? Can anyone explain ??

Make sure these boxes are checked before submitting your issue - thank you!

[+] I have checked the superset logs for python stacktraces and included it here as text if any
[+] I have reproduced the issue with at least the latest released version of superset
[+] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version
Expected results
Actual results
Steps to reproduce

Notice: this issue has been closed because it has been inactive for 304 days. Feel free to comment and request for this issue to be reopened.


a11y_Tabs> Scrolling> A11y> 2 incomplete is appearing

Describe the bug
Tabs>> "2 incomplete" is appearing for "Scrolling".
To Reproduce
Steps to reproduce the behavior:

Go to 'https://storybook-preview-290--upbeat-sinoussi-f675aa.netlify.app/?path=/story/tabs--scrolling'
Click on 'Accessibility" add on
"2 incomplete" is appearing

Expected behavior
"0 incomplete" should appear for Tabs> Scrolling.
Screenshots
https://somup.com/c3n26DTcVP
Desktop:

OS: [Win 10]
Browser [chrome]
Version [Version 98.0.4758.82 (Official Build) (64-bit)]

Fixed indirectly. This is no longer an issue in the latest version: https://storybook-preview-dev--upbeat-sinoussi-f675aa.netlify.app/?path=/story/tabs--scrolling

The issue is fixed.
Storybook Link : https://storybook-preview-dev--upbeat-sinoussi-f675aa.netlify.app/?path=/story/tabs--scrolling
See Screen-cast : http://somup.com/c3jQe4uJTb
Thanks!

Issue does not exist.
See Screen-cast : http://somup.com/c3jvi4UlJc


selector-no-redundant-nesting-selector incorrectly errors within a :where() selector

Hi, I have a selector like
.my-input {
  border-color: red;

  :where(&)::placeholder {
    color: gray;
  }
}

The selector-no-redundant-nesting-selector rule complains about Unnecessary nesting selector (&). I could use &::placeholder as the selector but that has more specificity than :where(&)::placeholder ((0,2,0) vs (0,1,0)) so the :where is necessary here.

Thanks! I guess that the rule is just not made to handle such selector, so this can be marked as a bug 😄


Option to support "globally allowed" OidcTrustedDomains.js

OidcTrustedDomains.js is currently forced to be filled in and the service worker will then only function on these domains.
I've made a tenant like system where multiple domains end up in the exact same application and it's impossible for me to know which application urls these are (they come from the database).
It would be nice that in certain scenarios that you could say
const trustedDomains = {
    default: ["*"]
};

To allow any domain to use the service worker.
The way I currently intend to solve this is by making a small REST api endpoint which simulates the content of OidcTrustedDomains.js which takes priority over the application itself but I don't know how (or if) that is gonna work.
This has a little bit of haste behind it as I cannot currently get my deployed application to work without this feature.

Hi @Thodor12 , thank you very much for your pullrequest and your issue. I will check it on monday, i have a busy week end. Do you know that allowing every domains your application will be weak against Xss attacks.
It would be possible for a hacker to retrieve easily the accesstoken and i think also refresh token.
Do you have the possibility to retrieve dynamicaly your domains from trusteddomains.js files? It would be a lot more secure.
I was thinking of the possibility to customize routes/domains like for example:
Https//.toto.com/api/
Which will resolve your use case too. But i think i would print big warning that just * it very weak.

My domains are completely random as they are user defined. I thought about providing an endpoint to load the OidcTrustedDomains.js file but that is out of the picture because this file is not actually fetched as a HTTP request from the service worker, it's just a webworker import require so that will not work.
The only way I see is by self managing the service worker file, providing the source through a HTTP endpoint myself and then embedding the trusted domains file directly in there, completely bypassing the generated service worker, but that will give me longevity problems with updates which is less than ideal.
As far as XSS goes I'm not worried, these tokens are specially signed from the backend to only work for that given domain, (plus people can grab the token anyway from the inspect element screen). They are also JWT tokens in the end so they are not possible to be modified.

These domains are used to feed my Traefik instance to set up dynamic routing for these domains, so I do have them stored in a database, as you can see in the image below these can be any domain (I redacted the original ones for privacy reasons).
I require my customers to actually setup DNS entries on their own host to point to this server.

Maybe we could just support this and mention it in the README, but with a disclaimer saying it's not recommended and should only be used "if you know what you're doing".

Hi @Thodor12 , don't worry I think I will merge your PullRequest tomorrow when I will be able to test it.
Yes, warning in documentation woulb be great.
After, i will improve you * system to be able to select path or subdomains or anything else ^^

Thank you for your issue an PullRequest :)

I have merge it. Than you very much @Thodor12 !
I keep the issue open.
I will enhance the code to support
Https//*.toto.com/api/ <-- i would set a star at the end but i cannot because it it makdown
configuration
and add Warning inside documentation about allowing every domains.

I have merge it. Than you very much @Thodor12 ! I keep the issue open. I will enhance the code to support Https//*.toto.com/api/ <-- i would set a star at the end but i cannot because it it makdown configuration
and add Warning inside documentation about allowing every domains.

Hello @guillaume-chervet, did you get to work on this one? How can I be of any help in giving a PR? I have not much idea about how the whole code base works, but i can try

Hi @abhilashlr7 , it is already working.
I keep the pullrequest open because i want to enhance the way to configure trusted domains with stars or regex 😀

yes, that is exactly what I am looking for.
I'd need support like https://*.abc.com/path. I could get a way working now in our application, but wouldn't scale well in the long run when updates are pushed. I will see if I can send that as a PR soon

It would be awesome @abhilashlr7 :)

It would be awesome @abhilashlr7 :)

https://github.com/AxaGuilDEv/react-oidc/pull/935 addresses this one. but it is regex based. Let me know if that works.

Thank you @abhilashlr, I have tested it and merged it so last published version contained it.
I keep the issue open to update the documentation.

Thank you @abhilashlr, I have tested it and merged it so last published version contained it. I keep the issue open to update the documentation.

Ah! Apologies to have missed it out. Will send a PR for that soon.


Option to copy values easily

On this page we can copy the values for particular scale but not for individual item. As a designer, I have to go to console panel and copy the code to bring that in Figma.
It'd be great to have option to copy hex code for any particular item from the scale i.e. gray-5.
Also, providing a Figma template for all the scales would also help designers work easily.

Hello :)
I made a Pull request : https://github.com/radix-ui/website/pull/728


How do I bind components to redux state

Hey
I working on a template for my company and I'm still learning about react, redux all this "whole new world".
I picked many examples and created mine, it was working. However, I didn't like about the file's and folder's structure and started reworking it.
Now I have:

containers

App

components

core
Global

Actions
Reducer
Actiontypes

Login

Actions
Reducer
View
Actiontypes

Home

Actions
Reducer
View
Actiontypes

Etc... (more views)

Now I'm stuck with something I don't understand.
I've my global actions and reducer that operates the following state:

token
userName
isAuthenticated

export function setUserInfo(token, userName) {
    localStorage.setItem("token", token);
    return {
        type: T.SET_USER_INFO,
        payload: {
            token: token,
            userName: userName,
            isAuthenticated: true
        }
    }
}

export function cleanUserInfo() {
    localStorage.removeItem("token");
    return {
        type: T.CLEAN_USER_INFO,
        payload: {
            token: null,
            userName: null,
            isAuthenticated: false
        }
    }
}

reducer

const initialState = {
    token: null,
    userName: null,
    isAuthenticated: false
};

export default createReducer(initialState, {
    [REHYDRATE]: (state, payload) => {
        const savedData = payload.global || initialState;
        return {
            ...state,
            ...savedData
        };
    },
    [T.SET_USER_INFO]: (state, payload) => {
        return Object.assign({}, state, {
            "token": payload.token,
            "userName": payload.userName,
            "isAuthenticated": payload.isAuthenticated
        });
    },
});

then I've my App.js where I choose If the user should see the Authenticated Layout or the Unauthenticated Layout:
import React from "react";
import {connect} from "react-redux";
import Authed from "./Layout/Authenticated";
import UnAuthed from "./Layout/UnAuthenticated";

class CoreLayout extends React.Component {

    render() {
        return (
            <div>
                {this.props.isAuthenticated
                    ? <Authed children={this.props.children}/>
                    : <UnAuthed children={this.props.children}/>}
            </div>
        );
    }
}

const mapStateToProps = (state) => {
    return { isAuthenticated: state.global.isAuthenticated };
};

export default connect(mapStateToProps)(CoreLayout);

But when my page is hitted, it shows the Authenticated Layout with the login page, even when isAuthenticated: false
I think that mapStateToProps handles the redux state changes through connect, however it isn't working.
Where am I failing?

configureStore

import rootReducer from "../reducers";
import thunkMiddleware from "redux-thunk";
import {createStore, applyMiddleware, compose} from "redux";
import {routerMiddleware} from "react-router-redux";
import {persistState} from "redux-devtools";
import { persistStore, autoRehydrate } from "redux-persist";
import crosstabSync from "redux-persist-crosstab";
import createLogger from "redux-logger";
import DevTools from "../dev/DevTools";

const loggerMiddleware = createLogger();

const enhancer = (history) =>
    compose(
        // Middleware you want to use in development:
        applyMiddleware(thunkMiddleware, loggerMiddleware, routerMiddleware(history)),
        // Required! Enable Redux DevTools with the monitors you chose
        DevTools.instrument(),
        persistState(getDebugSessionKey()),
        autoRehydrate({log: true})
    );

function getDebugSessionKey() {
    // You can write custom logic here!
    // By default we try to read the key from ?debug_session=<key> in the address bar
    const matches = window.location.href.match(/[?&]debug_session=([^&#]+)\b/);
    return (matches && matches.length > 0)? matches[1] : null;
}

export default function configureStore(history, initialState) {
    // Add the reducer to your store on the `routing` key
    const store = createStore(rootReducer, initialState, enhancer(history))

    if (module.hot) {
        module
            .hot
            .accept("../reducers", () => {
                const nextRootReducer = require("../reducers");
                store.replaceReducer(nextRootReducer);
            });
    }

    const persistor = persistStore(store);
    crosstabSync(persistor);

    return store;
}

Entry point (index.js)

import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
import { hashHistory, Router } from "react-router";
import { loginUserSuccess } from "./actions/auth";
import { syncHistoryWithStore } from "react-router-redux";
import { Provider } from "react-redux";
import { AppContainer } from "react-hot-loader";
import routes from "./routes";

import "bootstrap/dist/css/bootstrap.css";
import "bootstrap/dist/js/bootstrap";
import "./assets/styles/main.scss";

const target = document.getElementById("root");
const store = configureStore(hashHistory, window.__INITIAL_STATE__);
// Create an enhanced history that syncs navigation events with the store
const history = syncHistoryWithStore(hashHistory, store)

const render = () =>
    ReactDOM.render(
    <AppContainer>
        <Provider store={store}>
            <Router routes={routes} history={history} />
        </Provider>
    </AppContainer>,
    target
);

let token = localStorage.getItem("token");
if (token !== null) {
    store.dispatch(loginUserSuccess(token));
}

render();

if (module.hot) module.hot.accept("/", () => render());

combineReducers (Reducers/Index.js)

import { combineReducers } from "redux";
import global from "../components/Global/Reducer";
import login from "../components/Login/Reducer";
import data from "../components/Protected/Reducer";
import {  routerReducer } from "react-router-redux";

export default combineReducers({
    global,
    login,
    data,
    routing: routerReducer
})

Versions
Redux @3.6.0
React @15.4.2
Windows 10
Node @6.9.5

Ok, I've found that App.js render() was being called twice.
The first hit:
isAuthenticated: false
second hit:
isAuthenticated: true
I commented redux-persist and persistor, and it started working. I'll now see what I made wrong with the persist.

This is a usage question, and should really be asked on Stack Overflow instead.
You may also want to read through some of the Redux tutorials listed here: https://github.com/markerikson/react-redux-links/blob/master/redux-tutorials.md .


Unconvertable xsd schema

Thank you very much for this hugely brilliant work.
I have a complex xsd file which triggers #86 and #96 but I can live with that as it is only one line I can insert myself. For documentation the offending line for those issues is here https://gist.github.com/Toasterson/5dd1db9c7862450c981ffd10f04d849b#file-service_bundle-xsd-L1339
However, it is also tripping somehow on the generated go code with:
service_bundle.go:3:7: expected 'IDENT', found 'struct' (and 1 more errors) in package smf

type  struct {
        Type Anon52 `xml:"type,attr"`
}
// May be one of
type Anon1 string
// May be one of constraints, values
type Anon52 string

type Any []string

func (a Any) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
        var output struct {
                ArrayType string   `xml:"http://schemas.xmlsoap.org/wsdl/ arrayType,attr"`
                Items     []string `xml:" item"`
        }
        output.Items = []string(a)
        start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{"", "xmlns:ns1"}, Value: "http://www.w3.org/2001/XMLSchema"})
        output.ArrayType = "ns1:anyType[]"
        return e.EncodeElement(&output, start)
}
func (a *Any) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error) {
        var tok xml.Token
        for tok, err = d.Token(); err == nil; tok, err = d.Token() {
                if tok, ok := tok.(xml.StartElement); ok {
                        var item string
                        if err = d.DecodeElement(&item, &tok); err == nil {
                                *a = append(*a, item)
                        }
                }
                if _, ok := tok.(xml.EndElement); ok {
                        break
                }
        }
        return err
}

type Include struct {
        Fallback Any   `xml:" fallback"`
        Parse    Parse `xml:"parse,attr,omitempty"`
        Encoding       `xml:"encoding,attr,omitempty"`
}

func (t *Include) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
        type T Include
        var overlay struct {
                *T
                Parse *Parse `xml:"parse,attr,omitempty"`
        }
        overlay.T = (*T)(t)
        overlay.Parse = (*Parse)(&overlay.T.Parse)
        return d.DecodeElement(&overlay, &start)
}

type Lang string
// May be one of xml, text
type Parse string
// May be one of default, preserve
type Space string

All required xsd files are uploaded to a public gist. https://gist.github.com/Toasterson/5dd1db9c7862450c981ffd10f04d849b the original sources are open source.
I did convert this file from a dtd file with trang
If required I can also link the original dtd file.
Would love to use your tool to generate go types, as this allows me to write proper smf manifests on illumos systems.

The error is here (note the extra space)
type  struct {
        Type Anon52 `xml:"type,attr"`
}

It seems similar to #99 . It appears to be trying to generate a complexType with an attribute named "type". There are a lot of those in the gist you provided. If I had to guess, I suspect it's this one, since there's no additional fields inside the complexType:
 <xs:element name="include_values">
   <xs:complexType>
     <xs:attribute name="type" use="required">
       <xs:simpleType>
         <xs:restriction base="xs:token">
           <xs:enumeration value="constraints"/>
           <xs:enumeration value="values"/>
         </xs:restriction>
       </xs:simpleType>
     </xs:attribute>
   </xs:complexType>
 </xs:element>

I'm not sure when I'll get a chance to look further, but could you try slimming down your xsd and see if you could pinpoint the type that causes this? Then maybe the -vvv output from xsdgen could give us a clue (warning: it prints a lot of output).

I managed to get a working version with the alternate wool xgen and some heavy manual editing. Its at for a reference https://git.wegmueller.it/OpenCloud/opencloud/src/branch/master/smf/service_bundle.xsd.go
I tried to minify the file and see which type generates it and it turns out pretty much every one does...
Entry:
<xs:element name="doc_link">
    <xs:complexType>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="uri" use="required"/>
    </xs:complexType>
  </xs:element>

read service_bundle-min.xsd
read xml.xsd
setting namespaces to ["http://www.w3.org/XML/1998/namespace"]
complexType doc_link: could not find type  in namespace  for attribute name

I only found -vv as option not -vvv is that still enough output?


think of a good relation id for privilege-request-protocol's x-permission-request link

currently privilege-request-protocol.md uses x-permission-request as a placeholder for the link relation type for the privilege request endpoint URI.
let's think of a good link relation type. i believe this should be an Extention Relation Type URI rather than a simple registered relation name, so that coordination with the IANA won't be necessary (also they require a stable specification document to reference).  perhaps something in @prefix solid: <http://www.w3.org/ns/solid/terms#>?
there's already solid:loginEndpoint and solid:logoutEndpoint. perhaps

http://www.w3.org/ns/solid/terms#privilegeRequestEndpoint
http://www.w3.org/ns/solid/terms#permissionRequestEndpoint
your suggestion here

As per https://github.com/solid/app-authorization-panel/issues/27, I do not think the endpoint-centric nature of Privilege Request Protocol is a design that matches Solid.
We should avoid creating link relations for "endpoints", as they are not domain concepts within Solid. Although these exist for login and logout, those are for use with existing protocols that we did not define, and which do have the "endpoint" notion. (We still might to revise that, but this is another topic.)
If a suggestion such as https://github.com/solid/app-authorization-panel/issues/27 is followed, the link relation would be solid:permissionRequestInbox (or similar), subproperty of ldp:inbox. In case no solid:permissionRequestInbox is found for a resource, the regular ldp:inbox can be used.


schedules sum count

hi
every day
weekly
monthly
Can't count the number of schedules in units?
Is there an API to get the number of displayed schedules?
ex)

@mingiki
We don't have an interface to provide data of Schedule yet. You might need to manage another set of schedules and sync it to the calendar. and use the other set of schedules to extract information like the total count of schedules.
I understand this is a very uncomfortable approach. So Would it be ok if there's an API to get all schedules as an array? That wouldn't be hard to implement.
const cal = new Calendar(container, { /* ... */ });

cal.getAllSchedules(); // [/* a list of schedules you added by order */];

Except that, It's hard to provide an interface getting all schedules prettier at this moment.

@mingiki We decided not to implement a new API since the whole schedule data come from the outside of the calendar.
You need to implement your own calculation methods and inject those numbers into the calendar with templates.


It's not even good post, forwardtracking is useless

It's not even good post, forwardtracking is useless

what do you mean it's useless? if you are legit hacking it's useful, please if you want to say something explain it

forward tracking predicts player's movements, if the player moves in a different direction or change the velocity, you will overshoot

forward tracking predicts player's movements, if the player moves in a different direction or change the velocity, you will overshoot

Forgot about peeking?

why you crying when your posts doesnt get enough attention? it took a time to make new features in a cheat

ive seen better issues. you know, ones made by people that have tried doing something and not just begging?
please refer to this page on stackoverflow


overrding TemplateFinder to allow locate templates in all themes

Issue: templates under themes aren't compiled when running cache:warmup
Overriding original TemplateFinder to allow locate templates in themes.

composer update is eating > 1Gb of memory for PHP 5.3 and Symfony 2.7, so I've added travis.php.ini, where I'm increasing memory. (commits will be squashed)
see: raw log
[301.3MB/44.28s] Writing /home/travis/.composer/cache/repo/https---packagist.org/provider-symfony$web-profiler-bundle.json into cache
[1072.6MB/91.88s] Resolving dependencies through SAT

i think right now we do not have functional tests .. if you have time it would be good to add some to test this code.

thx!

Created https://github.com/symfony/symfony/pull/19703 for better DX


imagetoraster and 16bit images

When I print a 16bit TIFF file, imagetoraster fails with this in the debug logs:
   DEBUG: TIFF resolution = 70.866142x70.866142, units=3
   DEBUG: Stored resolution = 180x180 PPI
   DEBUG: Bad TIFF dimensions 2104x1488x16x3!
   ERROR: The print file could not be opened.
   ERROR: imagetoraster (PID 259068) stopped with status 1

If I convert the tiff to a 16bit PNG (and use a ppd which specifies /cupsBitsPerColor 16/ then the filter runs and produces a 16bit raster, but it is entirely blank white.
If I force cups to go via imagetopdf by disabling imagetoraster then things are better and gs produces a sensible 16bit raster.  The image values are not exactly the same as the input (some sample's channel values are 1-3 out compared to the original image). i.e. it passes an effectively 14-15bit per channel image to gutenprint.
I'm using Ubuntu 20.04 with cups 2.3.1-9ubuntu1.1 and cups-filters 1.27.4-1, and gutenprint 5.3.4.

Could you attach the 16-bit TIFF file here (or give me a link to a publicly available one)? Thanks.

Here are a 16bit PNG and 16bit TIFF (zipped as github doesn't like TIFF).
The files can be viewed with the Gnome image viewer, and opened by GIMP or ImageMagick.

1page.zip

I have checked and the function to read TIFF in libcupsfilters actually does not support 16 bit per color. There was no complaint about that for all the years and so I did not realize that. In addition, direct printing of files to CUPS (not using an application) is only rarely done. Therefore it is also planned to remove support for all image formats except JPG and PNG in cups-filters 2.x.
So I will have a look to see whether it is trivial to fix or whether it will be a wont-fix.
In general you can do high-color-depth printing via PNG and also via PDF (if you print your image from an application, the application will send PDF to CUPS).

GUI apps offer options and control via print dialogs but are not easily scripted, and it's often hard to have control of colour management.  (PhotoPrint works well with gutenprint printers by doing the RIP in app and send raw data to the print queue, but that has been unsupported for years and is unreliable on current OSs.)
PNG is fine as a TIFF alternative.  However, when I print the PNG file attached above, I get no errors in the log, but a blank print as output (it gives a totally white cups raster file).

GUI apps offer options and control via print dialogs but are not easily scripted, and it's often hard to have control of colour management.  (PhotoPrint works well with gutenprint printers by doing the RIP in app and send raw data to the print queue, but that has been unsupported for years and is unreliable on current OSs.)
PNG is fine as a TIFF alternative.  However, when I print the PNG file attached above, I get no errors in the log, but a blank print as output (it gives a totally white cups raster file).

@jpnp can you please provide the debug logs when the white page is printed?

@Harshit09-lang you will not need any more from the original poster, I could reproduce it, with both cups-filters 1.x and 2.x. Download this PPD file:
C43x.ppd.txt
and the PNG image from the original poster (click the image). Then run tthe following command line:
cat image.png | PPD=C43x.ppd.txt ./imagetoraster 1 1 1 1 'PageSize=A4 PwgRasterDocumentType=SRgb_16' > out.raster

image.png is the image from the original poster. Open out.raster with rasterview and you see a white page, but at least with correct metadata.


╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

Tried to create a bot using the following prompt.
Write a discord bot in python that has a slash command named code that takes a prompt as input and generates files on the disk and sends those files back to the user

Got the following error.

This is an error from the generated code, not the gpt-engineer code right?:)

It might be related to the generated project but the workspace folder for the project is empty so my guess is that maybe an error in the project made it crash before generating the files?

@BirgerMoell how did you make the traceback so pretty?
@AntonOsika it seems to be gpt-engineer's error since I get the same exception while generating a JS-only project.

level_loader.js
```javascript
class LevelLoader {
  constructor() {
    this.levels = [
      // Level data in JSON format
    ];
  }

  loadLevel(level) {
    return this.levels[level];
  }
}
```

main.js
```javascript
const game = new Game();
game.start();
Traceback (most recent call last):

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/urllib3/response.py", line 710, i
n _error_catcher
    yield

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/urllib3/response.py", line 1077,
in read_chunked
    self._update_chunk_length()

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/urllib3/response.py", line 1012,
in _update_chunk_length
    raise InvalidChunkLength(self, line) from None

urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/requests/models.py", line 816, in
 generate
    yield from self.raw.stream(chunk_size, decode_content=True)

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/urllib3/response.py", line 937, i
n stream
    yield from self.read_chunked(amt, decode_content=decode_content)

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/urllib3/response.py", line 1106,
in read_chunked
    self._original_response.close()

  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/urllib3/response.py", line 727, i
n _error_catcher
    raise ProtocolError(f"Connection broken: {e!r}", e) from e

urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)
", InvalidChunkLength(got length b'', 0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/ubuntu/src/gpt-engineer/venv/bin/gpt-engineer", line 8, in
    sys.exit(app())

  File "/home/ubuntu/src/gpt-engineer/gpt_engineer/main.py", line 61, in main
    messages = step(ai, dbs)

  File "/home/ubuntu/src/gpt-engineer/gpt_engineer/steps.py", line 121, in gen_clarified_code
    messages = ai.next(messages, dbs.identity["use_qa"])

  File "/home/ubuntu/src/gpt-engineer/gpt_engineer/ai.py", line 55, in next
    for chunk in response:

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/openai/api_resources/abstract/eng
ine_api_resource.py", line 166, in
    return (

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/openai/api_requestor.py", line 69
2, in
    return (

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/openai/api_requestor.py", line 11
5, in parse_stream
    for line in rbody:

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/requests/models.py", line 865, in
 iter_lines
    for chunk in self.iter_content(

  File "/home/ubuntu/src/gpt-engineer/venv/lib/python3.8/site-packages/requests/models.py", line 818, in
 generate
    raise ChunkedEncodingError(e)

requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 byt
es read)", InvalidChunkLength(got length b'', 0 bytes read))

I just got this error, I already gave the program some code so I believe I know what it is writing.
  invoices = relationship("InvoiceMapping", back_populatesTraceback (most recent call last):
the correct line is:
invoices = relationship("InvoiceMapping", back_populates="bill_of_lading")
I get the chunk error at the same spot every time.
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)

I am experiencing the same issue. I've run it roughly 20 times, and every time it has crashed. I've updated the main_prompt in many different ways as well.
Traceback (most recent call last):
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 761, in _update_chunk_length
self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 444, in _error_catcher
yield
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 828, in read_chunked
self._update_chunk_length()
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 765, in _update_chunk_length
raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/work/anaconda3/lib/python3.10/site-packages/requests/models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 624, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 816, in read_chunked
with self._error_catcher():
File "/Users/work/anaconda3/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "/Users/work/anaconda3/lib/python3.10/site-packages/urllib3/response.py", line 461, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/work/anaconda3/bin/gpt-engineer", line 8, in
sys.exit(app())
File "/Users/work/anaconda3/lib/python3.10/site-packages/gpt_engineer/main.py", line 60, in main
messages = step(ai, dbs)
File "/Users/work/anaconda3/lib/python3.10/site-packages/gpt_engineer/steps.py", line 127, in gen_clarified_code
messages = ai.next(messages, dbs.preprompts["use_qa"])
File "/Users/work/anaconda3/lib/python3.10/site-packages/gpt_engineer/ai.py", line 55, in next
for chunk in response:
File "/Users/work/anaconda3/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 166, in
return (
File "/Users/work/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 692, in
return (
File "/Users/work/anaconda3/lib/python3.10/site-packages/openai/api_requestor.py", line 115, in parse_stream
for line in rbody:
File "/Users/work/anaconda3/lib/python3.10/site-packages/requests/models.py", line 865, in iter_lines
for chunk in self.iter_content(
File "/Users/work/anaconda3/lib/python3.10/site-packages/requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

Some possible clarification (form ChatGPT) on what's going on with this issue. https://chat.openai.com/share/83b0156d-aa19-45a8-b6d5-d5baf7edfe51

Closing since I haven't heard more about this issue lately

I think the issue might still persists. Following is the exception I am receiving.
"File "$\anaconda3\envs\gpt-eng\Lib\site-packages\urllib3\response.py", line 710, in _error_catcher
yield
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\urllib3\response.py", line 1077, in read_chunked
self._update_chunk_length()
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\urllib3\response.py", line 1012, in _update_chunk_length
raise InvalidChunkLength(self, line) from None
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\requests\models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\urllib3\response.py", line 937, in stream
yield from self.read_chunked(amt, decode_content=decode_content)
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\urllib3\response.py", line 1065, in read_chunked
with self._error_catcher():
File "$\anaconda3\envs\gpt-eng\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\urllib3\response.py", line 727, in _error_catcher
raise ProtocolError(f"Connection broken: {e!r}", e) from e
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "$\gpt-engineer\gpt_engineer\main.py", line 101, in
app()
File "$\gpt-engineer\gpt_engineer\main.py", line 91, in main
messages = step(ai, dbs)
^^^^^^^^^^^^^
File "$\gpt-engineer\gpt_engineer\steps.py", line 199, in gen_clarified_code
messages = ai.next(messages, dbs.preprompts["generate"], step_name=curr_fn())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$\gpt-engineer\gpt_engineer\ai.py", line 173, in next
response = self.llm(messages, callbacks=callsbacks)  # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\langchain\chat_models\base.py", line 551, in call
generation = self.generate(
^^^^^^^^^^^^^^
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\langchain\chat_models\base.py", line 309, in generate
raise e
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\langchain\chat_models\base.py", line 299, in generate
self._generate_with_cache(
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\langchain\chat_models\base.py", line 446, in _generate_with_cache
return self._generate(
^^^^^^^^^^^^^^^
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\langchain\chat_models\openai.py", line 333, in _generate
for chunk in self._stream(
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\langchain\chat_models\openai.py", line 305, in _stream
for chunk in self.completion_with_retry(
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 166, in
return (
^
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\openai\api_requestor.py", line 692, in
return (
^
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\openai\api_requestor.py", line 115, in parse_stream
for line in rbody:
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\requests\models.py", line 865, in iter_lines
for chunk in self.iter_content(
File "$\anaconda3\envs\gpt-eng\Lib\site-packages\requests\models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
"

@AntonOsika Can you re-open this please?

I hesitated a little in reopening this, since the latest reported error goes through langchain, which is a dependency that didn't exist at the time of the original issue. Going ahead, it could be valuable with a little more information about the prompt and GPT version used @bhanupbalusu .

Closed with 5 days of triage


Endpoint /api/me/roles returns 401 "Not authorized" despite valid access token

I am running Superset 3.0.0 with Docker Compose. Trying to access the following API endpoint:
/api/me/roles

I have created an access token from /api/v1/security/login for a user with the Admin, Public and Gamma roles. I make a request for the mentioned API endpoint with the appropriate header.
Authorization: Bearer {access-token}
Accept: application/json

Various endpoints return 200 and a valid JSON payload, such as /api/v1/dashboard and /api/v1/chart. However, the
/api/me/roles endpoint returns 401 "Not authorized". This blocks the embedded dashboard feature. Could this be a bug, or am I doing something wrong? I sense there is something special with this endpoint and authentication as it relates to the currently authenticated user.
The /api/me/roles endpoint returns the roles when I log in through the UI and load the endpoint in a web browser.
Expected results
I expect the roles to be returned from the API with 200 OK status.
Actual results
The endpoint returns 401 "Not authorized" despite the access token seemingly being valid.
Environment
(please complete the following information):

Chrome latest.
Linux Ubuntu 22.04.
Superset 3.0.0 on Docker Compose in production mode

Flags
WTF_CSRF_ENABLED = False
TALISMAN_ENABLED = False
ENABLE_CORS = True

Still happening in 3.0.1

You can try a fix around by hitting a get request to http://localhost:8088/login endpoint and sending the csrf_token obtained along with username and password as formData and then get the access token to request http://localhost:8088/api/v1/me/roles api

Still happening in 3.1.1, also blocking usage of embedded dashboards.  Unfortunately the workaround above won't work because the embed SDK won't do that for me

Digging into this more, it seems /api/v1/security/login does not set a session cookie; hence, the /api/v1/me and underlying calls fail b/c there's no session cookie

Digging into this more, it seems /api/v1/security/login does not set a session cookie; hence, the /api/v1/me and underlying calls fail b/c there's no session cookie

I am facing the same issue
Normally, how can I get the session cookie?

Still happening in 3.1.1, also blocking usage of embedded dashboards. Unfortunately the workaround above won't work because the embed SDK won't do that for me

So superset only returns the dashboard available to that user according to the role defined

Digging into this more, it seems /api/v1/security/login does not set a session cookie; hence, the /api/v1/me and underlying calls fail b/c there's no session cookie

I am facing the same issue Normally, how can I get the session cookie? if /api/v1/security/login doesn't return it, is there any other way to login and get cookie? how did superset work if there is no session cookie?

I had to do a hack (emphasis on hack: this is not production ready code, please review it b/c if done wrong it creates a security hole) to basically take a JWT, verify it, find the corresponding user, then login that user again. The result is a cookie getting set on response:
class CustomOAuthView(AuthOAuthView):

    @expose('/custom/session-by-jwt', methods=['GET'])
    def session_by_jwt(self, provider= None):
        # get the jwt in the request
        current_jwt = request.headers.get('Authorization').split(' ')[1]

        # decode the jwt to get the claims
        import jwt
        try:
            jwt_options = {
                'verify_signature': False, # TODO: get the public key from the jwks_uri to verify the signature
                'verify_exp': True,
                'verify_nbf': False,
                'verify_iat': True,
                'verify_aud': False
            }
            jwt_decoded = jwt.decode(jwt=str.encode(current_jwt), algorithms=['HS256'], options=jwt_options)

            # get the user from the jwt
            user = self.appbuilder.sm.find_user(email=jwt_decoded['sub'])

            # create a session cookie for the user
            login_user(user)
        except Exception as e:
            print(f"Exception: {e}")
            return "Invalid JWT"
        return "session_by_jwt"

Digging into this more, it seems /api/v1/security/login does not set a session cookie; hence, the /api/v1/me and underlying calls fail b/c there's no session cookie

I found out that if we set those flag in superset config:
SESSION_COOKIE_HTTPONLY = False
SESSION_COOKIE_SECURE = False
the /api/v1/security/login endpoint will return a cookie like this:

is this the right cookie? if so, how to use it? I tried to add it in postman but it doesn't work

Ah, good find! Yeah, that's looks close, the one I have starts with a ..   Digging into the superset_config.py in the main repo, I see this:
#
# Flask session cookie options
#
# See https://flask.palletsprojects.com/en/1.1.x/security/#set-cookie-options
# for details
#
SESSION_COOKIE_HTTPONLY = True  # Prevent cookie from being read by frontend JS?
SESSION_COOKIE_SECURE = False  # Prevent cookie from being transmitted over non-tls?
SESSION_COOKIE_SAMESITE: Literal["None", "Lax", "Strict"] | None = "Lax"
# Whether to use server side sessions from flask-session or Flask secure cookies
SESSION_SERVER_SIDE = False
# Example config using Redis as the backend for server side sessions
# from flask_session import RedisSessionInterface
#
# SESSION_SERVER_SIDE = True
# SESSION_USE_SIGNER = True
# SESSION_TYPE = "redis"
# SESSION_REDIS = Redis(host="localhost", port=6379, db=0)
#
# Other possible config options and backends:
# # https://flask-session.readthedocs.io/en/latest/config.html

Perhaps switch to server side sessions might help?

Perhaps switch to server side sessions might help?
I tried, but still not working
Any other idea?

Hi all,
same problem here. Do I have to rollback on version 2 or do you think this problem may be fixed in a rather short time ?
Thx !!

@mortenesbensen when you say it "wasn't formatted correctly" what was the issue? I think we're running into this same issue now.

Hello,
I am new to Apache Superset and am working on integrating REST APIs for CRUD operations within my project. I understand that in order to interact with the Superset REST APIs, I need to obtain an API token. Could you please provide guidance on how to retrieve the API token either through the Superset UI or by sending HTTP requests?
For context, I have already configured Keycloak for authentication, and would appreciate any instructions or references to help me proceed.
Thank you for your assistance!


Switch to Mirror Branch action

Fixes #7
TODOs:

[ ] @chancancode will test this on https://github.com/chancancode/ember-concurrency-async
[ ] @dscho mind trying this out to see if it works in your setup?

cc @zofrex

Interesting! It uses the GitHub API directly and should therefore be much faster even than a partial clone...
I will test this in my setups as soon as I'm on a computer again, but I don't expect any problems: in my experience, GitHub API calls are very robust.

I tested this on https://github.com/chancancode/ember-concurrency-async and it worked perfectly, I made a small tweak to disable force pushing (it is enabled by default for some reason, but shouldn't be necessary here). As far as I am concerned, this is good to go so @dscho feel free to merge this whenever you have a chance to confirm that it works for you. Thanks @zofrex!

Re: force pushing, I thought this was necessary to achieve "mirroring" in the sense that I personally expect that term to mean.
I am curious to hear why it is not necessary for you, and particularly what you want to happen in the event someone force pushes to your new base branch. You aren't the first person to raise an eyebrow at the default so perhaps it needs a change!

I am curious to hear why it is not necessary for you

I think the idea here is to have bidirectional mirroring between master and main, in case a developer pushed to master by accident. To support that scenario, we're using your Action twice: once in the direction main -> master, and then in the reverse. Now, if there is no divergence, one of those directions will result in a fast-forward and the other in a no-op.
But what if two developers pushed almost simultaneously to main and to master? In that case, we do not want one to "win" and the other to (silently!) "lose". After all, the user who pushed the revision that would be overwritten by the Action would have no feedback that their changes were reverted. That's why we don't want to force the push.


Forced update: "Remind me next time I open app" not enforced correctly

Bug Description
Related to https://github.com/Concordium/concordium-reference-wallet-android/issues/45
Steps to Reproduce

Use an app that has been set up
Open the app and see the "Update ready" popup
Click "Remind me next time I open the wallet"
Click on an account, the more tab, backup tab or similar
Return to the accounts tab

Expected Result
The accounts tab is shown without a popup
Actual Result
The "Update ready" popup is shown again.
Versions

Software Version: 3.0.4 (88)
OS: Android 9
Mobile device: Huawei

Fixed in version 3.0.5 (89)

The solution has been verified. It now works as expected.


Symbolic execution cannot generate tests in case of specific Random usage

Description
In some cases when random numbers are generated in fixed loop, symbolic engine cannot generate any test.
To Reproduce

Install UnitTestBot plugin built from main in IntelliJ IDEA
In settings set Symbolic = 100%
Generate tests for following code

    public int randomSum(int n) {
        List<Integer> weight = new ArrayList<>();
        for (int i = 0; i < 4; i++) {
            weight.add(new Random().nextInt(n));
        }

        return weight.size();
    }

Expected behavior
Tests are generated, similar to what is listed in 'Additional context' section.
Actual behavior
No tests are generated.
Additional context
In case loop statement changed to
for (int i = 0; i < n; i++)
then it starts working similar to what is expected:
public final class RecursionTest {
    ///region Test suites for executable org.example.Recursion.randomSum

    ///region SYMBOLIC EXECUTION: SUCCESSFUL EXECUTIONS for method randomSum(int)

    /**
     * @utbot.classUnderTest {@link Recursion}
     * @utbot.methodUnderTest {@link Recursion#randomSum(int)}
     * @utbot.returnsFrom {@code return weight.size();}
     */
    @Test
    @DisplayName("randomSum: -> return weight.size()")
    public void testRandomSum_ReturnWeightSize() {
        Recursion recursion = new Recursion();

        int actual = recursion.randomSum(0);

        assertEquals(0, actual);
    }

    /**
     * @utbot.classUnderTest {@link Recursion}
     * @utbot.methodUnderTest {@link Recursion#randomSum(int)}
     * @utbot.iterates iterate the loop {@code for(int i = 0; i < n; i++)} once
     * @utbot.returnsFrom {@code return weight.size();}
     */
    @Test
    @DisplayName("randomSum: RandomNextInt -> return weight.size()")
    public void testRandomSum_ListAdd() {
        MockedConstruction mockedConstruction = null;
        try {
            mockedConstruction = mockConstruction(Random.class, (Random randomMock, Context context) -> (when(randomMock.nextInt(anyInt()))).thenReturn(0));
            /* WARNING!!! Automatically used "Mockito static mocking" framework for mocking statics
            because execution encountered flaky methods
            To change this behaviour edit [Settings -> UtBot -> Force static mocking] */
            Recursion recursion = new Recursion();

            int actual = recursion.randomSum(1);

            assertEquals(1, actual);
        } finally {
            mockedConstruction.close();
        }
    }

@tyuldashev
Can you please verify this bug is reproducing on the plugin from the latest main?
Test with mock of Random is generated with Symbolic 100% for this code snippet.

Indeed, now it's fixed.


Package pathfinding-visualiser as a polymer app

Vucanize can be left up to the consumer when this happens.

Currently pathfinding-visualiser depends on js-data-structures which is in npm. This does not work at projects that depend on this project cannot use the postinstall build hooks to run npm install. js-data-structures probably needs to be put in bower.


dashboard,config: support dashboard dynamic public path prefix

What problem does this PR solve?
Resolve https://github.com/pingcap-incubator/tidb-dashboard/issues/480
What is changed and how it works?

Upgrade tidb-dashboard.
Add PublicPathPrefix config.
copy assetfs in tidb-dashboard.

Check List
Tests
Code changes

Has configuration change

Side effects
Related changes
Release note
support dashboard dynamic public path prefix

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Custom genome use isn't clear

Hey, thanks for the awesome tool, but it isn't very clear what the input to EGF is.
I had originally assumed that EGF has to be between 0-1. But simply providing the effective genome size is also accepted.
Is providing a custom chromosome fasta file + a effective genome size for the EGF parameter correct? Or what is the actual input required? Do you NEED to calculate the fraction before feeding it i to epic? Or will it calculate it for you with some combination of info?
Thanks!

I will look into this in December when I have a vacation. Can you ping me then? If not, you are likely get good answers by copy-pasting some of the code into GPT4 and asking

I am also interested in this

Hi guys! Does anyone already get the answer? :)


Add user agent to Android build

Description:
We need this for checking end point calls from Android app

QA passed


Adding a project to existing solution fails with COR_E_EXCEPTION

Repro steps:

Create a blank solution and open it.
File > New > Project
Select R Project
Select "Add to Solution" Option

No longer reproes. Reactivate if you still see it.


Check for mutually exclusive flags

Error out if more than one mutually exclusive flags are passed
in to kpod ps
Addresses issue @rhatdan raised in https://github.com/projectatomic/libpod/pull/123#pullrequestreview-82995550
Signed-off-by: umohnani8<EMAIL_ADDRESS>

@rhatdan @mheon PTAL

LGTM

FWIW @umohnani8 looks like more fun with "unable to find image 'registry.fedoraproject.org/fedora:26' locally", not related to these changes.

@rhatdan PTAL

@rh-atomic-bot r+


Basic plus ui, RequireJS, Backbone Example

I use fews days to kick start the basic plus ui with requirejs and backbone but it still stucked. Please provide help. If there is any example to doing this that will be great.

I've marked this as feature request.
Please note that the Wiki is user editable

There's a link to a 404 in the Wiki that I thought I'd help fix. However from the web front end point of view, I'm not seeing the usual Github Edit button. as the Wiki actually been closed?

The wiki used to be user editable, but I've disabled this feature after misuse.
Feel free to comment or mail me changes in the wiki you'd like to see and I will add them if appropriate.

The wiki used to be user editable, but I've disabled this feature after misuse.
Feel free to comment or mail me changes in the wiki you'd like to see and I will add them if appropriate.

Fair enough! I thought that might be the case re abuse.  Wikipedia has had it for decades!
Would more than happily help you improve documentation if you can help me understand the code better sometimes. I don't want to be a hit-and-run user of open source and I really do appreciate this plugin immensely. Also appreciate you have limited time available though.
Just one thing I noticed, is there still a basic-plus example? It would appear not as this page 404s:
https://github.com/blueimp/jQuery-File-Upload/blob/master/basic-plus.html
... and I'm not seeing a file with that name in the release I downloaded.
Perhaps then the link to it should be removed from this page:
https://github.com/blueimp/jQuery-File-Upload/wiki/Plugin-files
https://i.imgur.com/nQuGRRU.png
If there is such an example page I'd love to see it :)
Perhaps we might best start a different Issue for documentation tweaks?

Thanks for the heads-up, that wiki page actually had 16 dead links. 🙀
The basic-plus example has been removed in this commit: 3142b42
The last tagged version that included it was v9.34.0
You might also benefit from this Wiki page:
https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin

Looking that this feature request is from 2014 and the basic-plus version is not anymore supported, I'll close this issue.


ARROW-64: Add zsh support to C++ build scripts

All scripts that have to be sourced during development currently only
support bash. This patch adds zsh support.

See also  https://github.com/apache/parquet-cpp/pull/78

+1, thank you


Added long press to fetch calendar mobile, fixed progress bar calenda…

…r fetch styling issue chrome, updated calendar tooltip, fixed landing page horizontal scrolling bug mobile

Is it ready to be reviewed and merged or is it still a draft @Fefedu973 ?

It depends of what needs to be added, is the long press on mobile already here ? Don't merge the landing page btw

@Truiteseche c'est prêt à merge

To solve the conflictt you should keep my version (i have implemented the get all fix in the request) btw i think the size of the pr should now be updated from XL to XXXL

Perfectly done. Thanks a lot 💯


ARROW-17960: [C++][Python] Implement list_slice kernel

Will fix ARROW-17960

There are three TODOs, (as noted in the code as well) let me know if you think any should be done on this PR:

I think those are certainly fine to leave as a follow-up.
For me, I think API wise I still have the questions:

What do we want to use as the default return type for slicing a variable size list? Return a fixed size list (padding with nulls to get the correct length), or keep a variable size list (not padding with nulls, just slice until the end if stop > size of a list element)
For slicing fixed size list arrays, what do we want to do when slicing until after the end (stop > list size)? Padding with nulls and always return a fixed size list of size stop - start, or slice until the end (Python slice semantics) and return a fixed size list of size min(list_size, stop -start)

What do we want to use as the default return type for slicing a variable size list? Return a fixed size list (padding with nulls to get the correct length), or keep a variable size list (not padding with nulls, just slice until the end if stop > size of a list element)

Right now it's set to return fixed size list, but I have no opinion on this.

For slicing fixed size list arrays, what do we want to do when slicing until after the end (stop > list size)? Padding with nulls and always return a fixed size list of size stop - start, or slice until the end (Python slice semantics) and return a fixed size list of size min(list_size, stop -start)

IMO, it should flow like this:

Input type -> FixedSizeLIstArray:

Return type -> FixedSizeListArray:

Slice to stop, padding if stop > list_size

Return type -> ListArray:

Slice to min(list_size, stop) TODO: this now raises an error, as it assumed to slice to stop always given a fixedsizelist as input; will update.

Input type -> ListArray:

Return type -> FixedSizeListArray:

Slice to stop padding if stop > list_size

Return type -> ListArray:

Slice to min(list_size, stop) with no null padding.

@lidavidm would you mind giving this a look when you have time?

@lidavidm thanks a lot for the review! Do you have an opinion on some of the API questions raised at https://github.com/apache/arrow/pull/14395#issuecomment-1293369447 ? (and Miles' answer just below)
I am still feeling unsure about the return_fixed_size_list keyword and its default. Especially if we would support "slicing until the end" (i.e. without specifying a stop), it feels strange that the default would then check for the longest list and pad all others (to produce a fixed size list).
Another default could be to always preserve the original type by default (so fixed size -> fixed size, variable size -> variable size), with still an option to choose explicitly. But then we need to make that keyword optional as well, since the default value would depend on the input type.

What do we want to use as the default return type for slicing a variable size list? Return a fixed size list (padding with nulls to get the correct length), or keep a variable size list (not padding with nulls, just slice until the end if stop > size of a list element)

IMO it makes more sense to slice variable sized lists to variable sized lists by default.

For slicing fixed size list arrays, what do we want to do when slicing until after the end (stop > list size)? Padding with nulls and always return a fixed size list of size stop - start, or slice until the end (Python slice semantics) and return a fixed size list of size min(list_size, stop -start)

I agree with Miles's proposal above.

@lidavidm is this OK for you?

Most of the R tests are failing, can we rebase and check?


Password restrictions

We should have some form for Auth password protection on the alpha version of the site when we've rolled it out onto the production servers.


Server Side Blazor project does not start browser

Issue Description
When starting Server Side Blazor project in debug mode browser does not start even though it is set to in the launch.json
Browser starts OK  in VS 2019 ok (it uses launchSettings.json)
App does start correctly its just you have to copy url from startup log into browser address bar
Steps to Reproduce
git clone https://github.com/mikes-gh/WebApplication1.git
F5
Expected Behavior
Browser Starts with URL of app
Actual Behavior
Browser does not start.  Have to start browser manually and copy and paste URL.
Logs
OmniSharp log
Post the output from Output-->OmniSharp log here
C# log
Post the output from Output-->C# here
Environment information
VSCode version: 1.33.1
C# Extension: 1.19.1
Mono Information
        OmniSharp using built-in mono
Dotnet Information
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview5-011568
 Commit:    b487ff10aa
Runtime Environment:
OS Name:     Mac OS X
OS Version:  10.13
OS Platform: Darwin
RID:         osx.10.13-x64
Base Path:   /usr/local/share/dotnet/sdk/3.0.100-preview5-011568/
Host (useful for support):
Version: 3.0.0-preview5-27626-15
Commit:  61f30f5a23
.NET Core SDKs installed:
2.2.105 [/usr/local/share/dotnet/sdk]
3.0.100-preview5-011568 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview5-19227-01 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview5-27626-15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions

Extension
Author
Version

csharp
ms-vscode
1.19.1

debugger-for-chrome
msjsdiag
4.11.3

gitlens
eamodio
9.7.3

mssql
ms-mssql
1.6.0

vscode-eslint
dbaeumer
1.8.2

@mikes-gh I believe I resolved this already in internal builds. If you look through the debug console, you should see a line like Now listening on: <some-url-here>. Do you have that? Does it start with white space?

On netcore 2.2
Launching browser (cmd.exe /C start http://localhost:5000)
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.

 Press Ctrl+C to shut down.
Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\mikes\Repos\WebApplication1
Microsoft.Hosting.Lifetime: Information: Hosting environment: Development

usinf the new
"serverReadyAction": {
        "action": "openExternally",
        "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
    }

One comment with the new config is not immediately obvious that it launches the browser
What is the meaning of openExternally?

Just tried 1.34 and note the problem is still there.  Is the new config for launch.json generated in a later build?

Just tried 1.20 and this is now fixed for me with the new serverReadyAction config


StackOverflowError on @java.lang.annotation.Documented due to self reference

What version of OpenRewrite are you using?
I am using
rewrite-java 8.23.1 through importing 2.9.0 rewrite-recipe-bom
How are you running OpenRewrite?
In production we plan to use the Maven plugin, and projects there are usually multi module projects,
however I can reproduce the error using a junit test in a single module setup
What is the smallest, simplest way to reproduce the problem?
The following produces a stackoverflow when used with MyRecipe. For details about MyRecipe see the attached maven project, which contains a downsized version of our original recipe.
	@Test
	void testReproduce() {
		rewriteRun(
			java(
				"""
					package com.yourorg;

					import java.io.Serializable;
					import javax.swing.JFrame;
					import de.parcit.base.resource.bl.shared.ResourceHelper;

					class A extends JFrame implements Serializable {
					}
				""",
				"""
					package com.yourorg;

					import java.io.Serializable;
					import javax.swing.JFrame;
					import de.parcit.base.resource.bl.shared.ResourceHelper;

					class A extends JFrame implements Serializable, Cloneable {
					}
				"""
			)
		);
		Assertions.assertTrue(true);
	}

What did you expect to see?
I did expect to not encounter a StackOverflowError caused by the self referencing @Documented annotation on JavaBean annotation on JFrame
@JavaBean(defaultProperty = "JMenuBar", description = "A toplevel window which can be minimized to an icon.")
@SwingContainer(delegate = "getContentPane")
@SuppressWarnings("serial") // Same-version serialization only
public class JFrame  extends Frame implements WindowConstants,

@Documented
@Target({TYPE})
@Retention(RUNTIME)
public @interface JavaBean {

The self reference from Documented to Documented causes the StackOverflowError
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documented {
}

What did you see instead?
I see a StackOverflowError when replacing interface implementations
What is the full stack trace of any errors you encountered?
too long, but includes repetitions of the following till StackOverflow is encountered
    at org.openrewrite.java.JavaTypeVisitor.visitClass (JavaTypeVisitor.java:121)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:188)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:185)
    at org.openrewrite.java.JavaTypeVisitor.visit (JavaTypeVisitor.java:75)
    at org.openrewrite.java.JavaTypeVisitor.lambda$visitClass$2 (JavaTypeVisitor.java:121)
    at org.openrewrite.internal.ListUtils.map (ListUtils.java:176)
    at org.openrewrite.java.JavaTypeVisitor.visitClass (JavaTypeVisitor.java:121)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:188)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:185)
    at org.openrewrite.java.JavaTypeVisitor.visit (JavaTypeVisitor.java:75)
    at org.openrewrite.java.JavaTypeVisitor.lambda$visitClass$2 (JavaTypeVisitor.java:121)
    at org.openrewrite.internal.ListUtils.map (ListUtils.java:176)
    at org.openrewrite.java.JavaTypeVisitor.visitClass (JavaTypeVisitor.java:121)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:188)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:185)
    at org.openrewrite.java.JavaTypeVisitor.visit (JavaTypeVisitor.java:75)
    at org.openrewrite.java.JavaTypeVisitor.lambda$visitClass$2 (JavaTypeVisitor.java:121)
    at org.openrewrite.internal.ListUtils.map (ListUtils.java:176)
    at org.openrewrite.java.JavaTypeVisitor.visitClass (JavaTypeVisitor.java:121)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:188)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:185)
    at org.openrewrite.java.JavaTypeVisitor.visit (JavaTypeVisitor.java:75)
    at org.openrewrite.java.JavaTypeVisitor.lambda$visitClass$2 (JavaTypeVisitor.java:121)
    at org.openrewrite.internal.ListUtils.map (ListUtils.java:176)
    at org.openrewrite.java.JavaTypeVisitor.visitClass (JavaTypeVisitor.java:121)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:188)
    at org.openrewrite.java.internal.template.JavaTemplateJavaExtension$1$1.visitClass (JavaTemplateJavaExtension.java:185)
    at org.openrewrite.java.JavaTypeVisitor.visit (JavaTypeVisitor.java:75)
    at org.openrewrite.java.JavaTypeVisitor.lambda$visitClass$2 (JavaTypeVisitor.java:121)
    at org.openrewrite.internal.ListUtils.map (ListUtils.java:176)

Are you interested in contributing a fix to OpenRewrite?
Would have to ask my employer.

I can't see my uploaded zip containing a small test case for reproduction, but I hope you have received it.

Oh wow, thanks for not including the full stacktrace in the case of a stack overflow. 😅  Weird to see that self referencing documented annotation causing issues here; definitely something we should fix in our parser. /cc @knutwannheden
I suspect we might even be able to trim down the reproduction test even further, just looking at how that's defined.
https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html
Thanks a lot for the level of detail in your report; much appreciated that we immediately have all the details visible here.

Hmm; I've tried to replicate this with a smaller unit test added to JavaParserTest, but no luck so far with
    @Test
    @Issue("https://github.com/openrewrite/rewrite/issues/4161")
    void documentedSelfReference() {
        rewriteRun(
          java(
            """
              import javax.swing.JFrame;
              class A extends JFrame {
              }
              """
          )
        );
    }

The reason I'm trying to replicate with a smaller sample is because I don't have access to the de.parcit.base classes listed above, and I wonder if those factor in to the failures you're seeing. Are you able to produce a test that fails without using external dependencies?

Sorry for not responding right away. I was on vacation for a few days.
Yes, I am able to reproduce without external dependencies. For your convenience I have added an updated test case: OpenRewriteProblem-2.zip
OpenRewriteProblem-2.zip
The reason why your test is not reproducing the problem is probably because you are not trying to apply the template Templates.implementCloneableTemplate included in the test case. The problem happens during template application.
		classDecl = Templates.implementCloneableTemplate.apply( 			updateCursor(classDecl), 			implementsClauseExists ? classDecl.getCoordinates().replaceImplementsClause() : classDecl.getCoordinates().addImplementsClause());

Looking over the zip I'm wondering if it'd be possible to replicate this with a self contained unit test; now it still refers to an external recipe, two visitors and a utility class. Ideally it'd be a a single unit test using spec-> spec.recipe(toRecipe(() -> new JavaVisitor<>(){ ... })), stripped from anything not necessary to replicate. As much as the zip is appreciated, I'm not finding the time to dive in there to resolve this among all the other items.

I can replicate this as well with a nonsense example (excluding any preconditions and just mutating the class declaration directly):
package com.sample.test;

import org.junit.jupiter.api.Test;
import org.openrewrite.ExecutionContext;
import org.openrewrite.java.JavaIsoVisitor;
import org.openrewrite.java.JavaParser;
import org.openrewrite.java.JavaTemplate;
import org.openrewrite.java.tree.J;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

import static org.openrewrite.java.Assertions.java;

public class StackOverFlowErrorOnAnnotation implements RewriteTest {

    @Override
    public void defaults(RecipeSpec spec) {
        spec.recipe(RewriteTest.toRecipe(() -> {
            return new JavaIsoVisitor<>() {

                @Override
                public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext executionContext) {
                    J.ClassDeclaration classDeclaration = super.visitClassDeclaration(classDecl, executionContext);
                    classDeclaration = JavaTemplate
                      .builder("Object")
                      .imports("java.lang.Object")
                      .javaParser(JavaParser.fromJavaVersion())
                      .build()
                      .apply(getCursor(), classDeclaration.getCoordinates().addImplementsClause());

                    return classDeclaration;
                }
            };
        }))
          .parser(JavaParser.fromJavaVersion()
            .classpath("junit-jupiter-api"));
    }

    @Test
    void stackOverflowOnImplements() {
        rewriteRun(
          // language=java
          java(
            """
              package com.sample.test;

              import org.junit.jupiter.api.DisplayName;

              @DisplayName("GIVEN a test with a '@DisplayName' annotation")
              abstract class MyClassWithDisplayNameAnnotation {}
              """,
            """
              package com.sample.test;

              import org.junit.jupiter.api.DisplayName;

              @DisplayName("GIVEN a test with a '@DisplayName' annotation")
              abstract class MyClassWithDisplayNameAnnotation implements Object {}
              """
          )
        );
    }

}

The DisplayName annotation is also annotated with the self referencing Documented annotation.

Thanks a lot @darthblonderss ; great to have a self-contained example. Did you already briefly explore a cause or fix?


ac:details usage issues

What happened?
I'm trying to use the ac:details template to populate page properties but i'm unable to due to errors in parsing.
com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format
What did you expect to happen?
I expected a page properties element with a table of key value pairs

How can we reproduce the behavior you experienced?
Using the following example

:details_start:
| Key1 | Key2 |
| --- | --- |
| Value1 | Value 2 |

:details_end:

Further Information (please complete the following information)

Mark Version (mark --version): v9.12.0
Mark Parameters: N/A
Confluence Hosting:  Cloud
Confluence Version: Cloud
Environment specific Information: Running in Windows

Logs or other output
Markdown parsing section of the log
2024-07-15 18:07:18.471 TRACE rendering markdown:

                              <ac:structured-macro ac:name="details" ac:schema-version="1""><ac:rich-text-body>
                              | Key1 | Key2 |
                              | --- | --- |
                              | Value1 | Value 2 |

                              </ac:rich-text-body></ac:structured-macro>

2024-07-15 18:07:18.471 TRACE rendered markdown to html:

<ac:structured-macro ac:name="details" ac:schema-version="1""><ac:rich-text-body>

                              Key1
                              Key2

                              Value1
                              Value 2

</ac:rich-text-body></ac:structured-macro>

Additional context
I'm unclear if my ac:details usage is correct.
Looking at the code it seems there's an extra " in the <ac:structured-macro ac:name="details" ac:schema-version="1""> line (here) but i'm unsure if that's the cause of my problem.
I don't currently have a golang build env otherwise I would test fixing it myself

Attempt 1 - Manual Definition (Fail)
I tried just defining the html manually, that seems to break due to the
 incorrectly wrapping the ac instead of the table

<ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body>

      Key1
      Key2

      Value1
      Value2

</ac:rich-text-body>
</ac:structured-macro>

TRACE
2024-07-15 18:20:09.558 TRACE rendering markdown:

                              <ac:structured-macro ac:name="details" ac:schema-version="1">
                              <ac:rich-text-body>

                                    Key1
                                    Key2

                                    Value1
                                    Value2

                              </ac:rich-text-body>
                              </ac:structured-macro>

2024-07-15 18:20:09.559 TRACE rendered markdown to html:

<ac:structured-macro ac:name="details" ac:schema-version="1">
                              <ac:rich-text-body>

                                    Key1
                                    Key2

                                    Value1
                                    Value2

                              </ac:rich-text-body>
                              </ac:structured-macro>

Attempt #2 - Manual Definition (Works)
If I take my table and make it a one-line it works. Here the
 surrounds the whole thing.
<ac:structured-macro ac:name="details" ac:schema-version="1">
<ac:rich-text-body>

Key1	Key2

Value1	Value2

</ac:rich-text-body>
</ac:structured-macro>

TRACE
2024-07-15 18:25:01.143 TRACE rendering markdown:

                              <ac:structured-macro ac:name="details" ac:schema-version="1">
                              <ac:rich-text-body>

Key1	Key2

Value1	Value2

                              </ac:rich-text-body>
                              </ac:structured-macro>

2024-07-15 18:25:01.144 TRACE rendered markdown to html:

<ac:structured-macro ac:name="details" ac:schema-version="1">
                              <ac:rich-text-body>

Key1	Key2

Value1	Value2

                              </ac:rich-text-body>
                              </ac:structured-macro>

Yes that unfortunately doesn't work right now. See also: https://github.com/kovetskiy/mark/issues/324

Btw I rebuilt it after removing the syntax error  (here) but the behavior remained the same.
Like you I looked into block parsing but couldn't get it to work properly. I ran it through the debugger for a while and finally gave up, waiting for someone smarter to dust it off :|

Good catch! Quoting is fixed in 9.13.1. Feel free to give it a shot.

Please test with https://github.com/kovetskiy/mark/releases/tag/10.0.0 and report back if it's still not working as expected.

Can confirm - working as expected now :clap:
024-08-01 12:10:51.432 TRACE rendering markdown:

                              <ac:structured-macro ac:name="details" ac:schema-version="1"><ac:rich-text-body>
                              | Key1 | Key2 |
                              | --- | --- |
                              | Value1 | Value 2 |

                              </ac:rich-text-body></ac:structured-macro>

2024-08-01 12:10:51.433 TRACE rendered markdown to html:
                              <ac:structured-macro ac:name="details" ac:schema-version="1"><ac:rich-text-body>

                              Key1
                              Key2

                              Value1
                              Value 2

                              </ac:rich-text-body></ac:structured-macro>


Upgrade fluentd-plugin-elasticsearch to latest version to support Elasticsearch 7.x well.

The fluentd-plugin-elasticsearch gem should be updated to at least v3.4.2 in order to support Elasticsearch 7.x without any flooding of warning messages.
See the below Slack thread and github issue for more information.
https://rancher-users.slack.com/archives/C3ASABBD1/p1558619528441700
https://github.com/uken/fluent-plugin-elasticsearch/issues/589
And here is the commit where the flooding of warning logs was fixed accordingly.
https://github.com/uken/fluent-plugin-elasticsearch/pull/573
It would also be prudent then to fix the default type_name setting of container_log to be _doc. Users can work-around this by providing their own fluentd config when enabling cluster/project logging, instead of using the UI.

We are currently also facing this issue with the rancher-logging-fluentd containers flooding the fluentd buffer of each node with following message like crazy:
[warn]: #0 Detected ES 7.x or above: `_doc` will be used as the document `_type`.

The message occurs thousands times each minute. Providing a complete custom fluentd config seems to be exaggerated given the extend and scope of the rancher-created fluentd configs (analyzed via secrets of cattle-logging namespace)
Isn't there an easy way to override type_name with _doc?

Unfortunately, it won't work. I've tried it. The issue is that the elasticsearch plugin had an issue in it where it would flood this message all of the time. Rancher uses the version of the plugin with this issue. The plugin has since fixed the issue, but Rancher needs to update its logging setup to use the newer plugin.

Thx for the quick response. In other words, the issue won't go away even if you provide custom fluentd config overriding type_name ? If so, what is your current workaround? Using an ElasticSearch version lower than 7?

At the moment I do not have a workaround to this from within Rancher, other than using ES 6.x. What I end up doing is deploying my own fluentd/elasticsearch setup from the official cluster addons repo: https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch

rancher/rancher:master-head ad1679532

Created a cluster
Deployed Elasticsearch
Enabled logging to Elasticsearch
Plugin version is 'fluent-plugin-elasticsearch' version '3.5.4'
Logs are shown correctly
No warning about _doc typename


Get all values from Flutter Form

Hi everyone
I cant find the right way to work with forms in Flutter.
Now if I want to send all values from form on submit, I need to create controller for each field and put all these values in the function call. This is normal if the form is small for 2-3 fields. And what if there are 10, 15 fields?
At the same time, I want to use third-party libraries to a minimum. In my opinion it would be very useful to be able to get all values for example by "_loginForm.currentState.values" as Map<fieldName, fieldValue>

You can't, just write a business logic that gets the values from TextEditingController if not, you can make one yourself

Thanks for the report! This is a known issue being tracked at #107528 and its PR is on the way.
Closing this issue as a duplicate, so please follow up on it for further updates.


Update to upstream 1.4.2 branch

This is a prerequisite for upgrading ES in boxen

Pulls in upstream/upgrade-1.4.2
Updates the javascript plugin to a compatible version
Doesn't disable scripting

/cc @envato/search

LGTM

Future plans include:

Finding a better way to get plugins installed (and submitting that patch upstream)
Abandoning this fork for upstream once possible
Upgrading to a released version, once we're ready to do so.


Update Readme - new version of Vault & typo fix

Fix a typo on the export env var statements (export was typed twice)
Update the download of vault examples to the latest one 0.10.2
With the upate of Vault - the CLI has changed when you want to add secrets its not write any more

just tested that 0.10.2 is not supported yet..


Update readme

Creating a tabular view for all the contributors

@adeora7  can you please verify.

@subinoy7 can you please include the newly added names also. There was a pending PR for the same so I had to see that first.

@adeora7 Thanks for the feedback and surely I will add the new contributors.

@adeora7 I have updated the new contributors list