text:
启动错误

配置的数据库db info经验证后正确但是  启动依然提示连接错误
Could not create connection to database server

Exception一般都有Caused by的，可以看下具体的报错信息。

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
这就是异常信息   也没提示别的错误

看一下mysql是否是8.0的，这个需要升级mysql connector的。。
详见 https://github.com/ctripcorp/apollo/issues/1096

确实查了下MySQL的版本是5.8的  然后换了一个5.7的版本  出现如下错误：2018-05-30 14:39:49.424 ERROR 58950 --- [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_APOLLO-CONFIGSERVICE/172.16.0.77:apollo-configservice:8080 - was unable to refresh its cache! status = Cannot execute request on any known server

是端口问题吗

刚启动报这个错是正常的，因为config service要向eureka注册，但是eureka还没启动好，过一会儿就OK了。

我看到这个说明了  但是我试了几次都没好   好像是只要报了这个错   整个进程就停止了

mysql 8.0需要用最新的master代码，后续会在0.11.0发布支持，详见 #1147

0.11.0版本已经发布，具体可以参考 Release Notes。
case先关闭了，如还有问题，可以提供更多信息，或进群交流。

2018-09-15 11:49:31.838 ERROR 9321 --- [main] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_APOLLO-CONFIGSERVICE/172.27.0.8:apollo-configservice:8080 - was unable to refresh its cache! status = Cannot execute request on any known server
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server 这是什么问题啊？

那为什么我的云服务器上得eureka一直都启动不了呢，试了好多次，都是启动失败！
jaychou206639073@aliyun.com
发件人： Jason Song
发送时间： 2018-09-15 22:20
收件人： ctripcorp/apollo
抄送： Jetty; Mention
主题： Re: [ctripcorp/apollo] 启动错误 (#1138)
@minemine678 刚启动时报这个错是正常的，因为eureka和config service是同一个进程，这时eureka还没起来。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

如果一直报的话，估计是配置有问题了，可以把完整的日志贴上来看看。

估计是ApolloConfigDB.ServerConfig中的eureka.service.url配置不对

对着啊，我写的就是本地ip+8080端口号，难道不是这样写的吗？
jaychou206639073@aliyun.com
发件人： Jason Song
发送时间： 2018-09-18 22:09
收件人： ctripcorp/apollo
抄送： Jetty; Mention
主题： Re: [ctripcorp/apollo] 启动错误 (#1138)
估计是ApolloConfigDB.ServerConfig中的eureka.service.url配置不对
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

您好：
难道不能使用外网IP地址访问吗？
jaychou206639073@aliyun.com
发件人： Jason Song
发送时间： 2018-09-18 22:09
收件人： ctripcorp/apollo
抄送： Jetty; Mention
主题： Re: [ctripcorp/apollo] 启动错误 (#1138)
估计是ApolloConfigDB.ServerConfig中的eureka.service.url配置不对
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

外网地址只要能访问到也是可以的，需要注意的是eureka.service.url配置是类似 http://x.x.x.x:8080/eureka

我就是这样配置的啊，为什么还是启动不了呢？
jaychou206639073@aliyun.com
发件人： Jason Song
发送时间： 2018-09-19 22:13
收件人： ctripcorp/apollo
抄送： Jetty; Mention
主题： Re: [ctripcorp/apollo] 启动错误 (#1138)
外网地址只要能访问到也是可以的，需要注意的是eureka.service.url配置是类似 http://x.x.x.x:8080/eureka
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

我就是这样配置的啊，为什么还是启动不了呢？ jaychou206639073@aliyun.com 发件人： Jason Song 发送时间： 2018-09-19 22:13 收件人： ctripcorp/apollo 抄送： Jetty; Mention 主题： Re: [ctripcorp/apollo] 启动错误 (#1138) 外网地址只要能访问到也是可以的，需要注意的是eureka.service.url配置是类似 http://x.x.x.x:8080/eureka — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

你好你的问题解决了么。我有类似问题。

2019-10-17 08:01:13.592  INFO 3502 --- [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_APOLLO-ADMINSERVICE/10.179.132.211:apollo-adminservice:8990: registering service...
2019-10-17 08:01:13.594 ERROR 3502 --- [DiscoveryClient-InstanceInfoReplicator-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27)
at com.sun.jersey.api.client.Client.handle(Client.java:652)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:570)
at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.register(AbstractJerseyEurekaHttpClient.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient.execute(MetricsCollectingEurekaHttpClient.java:73)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:118)
at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:79)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:119)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:815)
at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:120)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:134)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:117)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)
... 29 common frames omitted
2019-10-17 08:01:13.594  WARN 3502 --- [DiscoveryClient-InstanceInfoReplicator-0] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failure
2019-10-17 08:01:13.594  WARN 3502 --- [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_APOLLO-ADMINSERVICE/10.179.132.211:apollo-adminservice:8990 - registration failed Cannot execute request on any known server
遇到同样的问题

@kobe1996

我也遇到这个问题，搭测试环境，用的quick start all-in jar，demo.sh 启动， log里报下列错误：
2020-05-25 01:56:57.021 ERROR 2054 --- [main] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
DiscoveryClient_UNKNOWN/iZ8vbh6wqcumc4x3uxio58Z - was unable to refresh its cache! status = Cannot execute request on any known server
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
出于改错习惯总喜欢找第一个报错的地方，但作者有解释这个错不至于crash整个服务，后面会正常。网上又说是mysql版本或驱动有问题，所以把mysql docker从5.7.30 降到5.7.24降到文档提到5.7.11版本，不管用。
神奇的是，出错的是ECS centos linux 7（连的是上面运行的docker mysql）。同一份 quick start ，本机mac就没事（连的本机mysql）
在往下看日志，发现新错误
2020-05-25 01:57:05.765 ERROR 2054 --- [localhost-startStop-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : Table 'ApolloConfigDB.ServerConfig' doesn't exist
数据库表都是有的，从生产环境直接导出来来灌入docker mysql，navicat连上去挨个看数据都正常。开始没在意，突然发现ServerConfig是大小写，而灌入的表全都小写。想到mysql默认表都是区分大小写的， 所以把所有表改成单词首字母大写，问题解决！！
另外修改改my.cnf 里lower_case_table_names忽略表名大小写也应该可以，大家遇到这个问题试试看吧，我现在太晚了就不验证了，又是一个很困但是不眠之夜呀

@bamstars apollo安装sql文件中的表名都是大小写正确的，是否导入的时候有误导致变全小写了？配置 lower_case_table_names 应该也是可以的

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'restTemplateFactory' defined in file [D:\project\apollo\apollo-portal\target\classes\com\ctrip\framework\apollo\portal\component\RestTemplateFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageConverters' defined in class path resource [com/ctrip/framework/apollo/common/controller/HttpMessageConverterConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metaDataSourceAdvisor': Cannot resolve reference to bean 'methodSecurityMetadataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityMetadataSource' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.access.method.MethodSecurityMetadataSource]: Factory method 'methodSecurityMetadataSource' threw exception; nested exception is java.lang.IllegalArgumentException: org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity is required
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:1027)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:907)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:637)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:583)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:550)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:265)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1557)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1354)
at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver$1.getTarget(ContextAnnotationAutowireCandidateResolver.java:95)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
at com.ctrip.framework.apollo.portal.component.AdminServiceAddressLocator$$EnhancerBySpringCGLIB$$3cadf50e.getServiceList()
at com.ctrip.framework.apollo.portal.component.RetryableRestTemplate.getAdminServices(RetryableRestTemplate.java:226)
at com.ctrip.framework.apollo.portal.component.RetryableRestTemplate.execute(RetryableRestTemplate.java:133)
at com.ctrip.framework.apollo.portal.component.RetryableRestTemplate.get(RetryableRestTemplate.java:99)
at com.ctrip.framework.apollo.portal.api.AdminServiceAPI$HealthAPI.health(AdminServiceAPI.java:52)
at com.ctrip.framework.apollo.portal.component.PortalSettings$HealthCheckTask.isUp(PortalSettings.java:148)
at com.ctrip.framework.apollo.portal.component.PortalSettings$HealthCheckTask.run(PortalSettings.java:124)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageConverters' defined in class path resource [com/ctrip/framework/apollo/common/controller/HttpMessageConverterConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metaDataSourceAdvisor': Cannot resolve reference to bean 'methodSecurityMetadataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityMetadataSource' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.access.method.MethodSecurityMetadataSource]: Factory method 'methodSecurityMetadataSource' threw exception; nested exception is java.lang.IllegalArgumentException: org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity is required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 28 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metaDataSourceAdvisor': Cannot resolve reference to bean 'methodSecurityMetadataSource' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityMetadataSource' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.access.method.MethodSecurityMetadataSource]: Factory method 'methodSecurityMetadataSource' threw exception; nested exception is java.lang.IllegalArgumentException: org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity is required
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:693)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:198)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:91)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:111)
at org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator.findCandidateAdvisors(AnnotationAwareAspectJAutoProxyCreator.java:92)
at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.shouldSkip(AspectJAwareAdvisorAutoProxyCreator.java:101)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessBeforeInstantiation(AbstractAutoProxyCreator.java:255)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1135)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:531)
... 37 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityMetadataSource' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.access.method.MethodSecurityMetadataSource]: Factory method 'methodSecurityMetadataSource' threw exception; nested exception is java.lang.IllegalArgumentException: org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity is required
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:330)
... 56 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.access.method.MethodSecurityMetadataSource]: Factory method 'methodSecurityMetadataSource' threw exception; nested exception is java.lang.IllegalArgumentException: org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity is required
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 66 common frames omitted
Caused by: java.lang.IllegalArgumentException: org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity is required
at org.springframework.util.Assert.notNull(Assert.java:219)
at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.enableMethodSecurity(GlobalMethodSecurityConfiguration.java:444)
at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.prePostEnabled(GlobalMethodSecurityConfiguration.java:424)
at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.methodSecurityMetadataSource(GlobalMethodSecurityConfiguration.java:353)
at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 67 common frames omitted

authors: MrLW bamstars humingxu kobe1996 minemine678 nobodyiam wlkfec

repo: apolloconfig/apollo


text:
add new pmc member

add @klboke as a PMC member, see #4488

Codecov Report

Merging #4489 (7d59c41) into master (0f7dc80) will increase coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #4489   +/-   ##
=========================================
  Coverage     53.62%   53.62%
- Complexity     2699     2701    +2
=========================================
  Files           489      489
  Lines         15294    15294
  Branches       1588     1588
=========================================
+ Hits           8201     8202    +1
+ Misses         6537     6535    -2
- Partials        556      557    +1

Impacted Files
Coverage Δ

...mework/apollo/portal/component/PortalSettings.java
65.62% <0.00%> (-4.69%)
:arrow_down:

...work/apollo/biz/message/DatabaseMessageSender.java
64.58% <0.00%> (+8.33%)
:arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us.

source: gharchive/pull-request

authors: codecov-commenter nobodyiam

license_type: permissive

license_source: github-api


text:
Default parameters fail to be generated for Input Types

Apollo v1.2.0
I have an input type in my schema with default parameters.
input ObjectQuery {
  count: Int! = 20
  order: Sort! = DESC
}

The Kotlin models generated from this schema don't have these default parameters.

I think I'm getting a related error, it generated the following code which fails to compile:
val properties: Input<List<PropertyInput>> = Input.optional(listOf(""))

Schema:
input PropertyInput {
    key: String!
    value: String!
}
input Filter {
    properties: [PropertyInput!] = []
}

@AOrobator super strange, we do have tests for this: https://github.com/apollographql/apollo-android/blob/master/apollo-compiler/src/test/graphql/com/example/input_object_type/type/ReviewInput.kt
Could you please check that schema json has those default values for ObjectQuery?
@hameno It's a different error, I will take a look.

@sav007 I can verify that ObjectQuery specifies default values in schema.json. Let me know if I can provide additional info

@AOrobator may I get schema.json file somehow? You can DM it in slack.

@hameno PR to fix your issue is up https://github.com/apollographql/apollo-android/pull/1659

@AOrobator was this issue for Java or Kotlin models?

Kotlin models

Don't think I can send over my schema. I'll work on reproducing with a sample schema

Here's a snippet of the schema
{
  "kind": "INPUT_OBJECT",
  "name": "ObjectQuery",
  "description": "",
  "fields": [],
  "inputFields": [
    {
      "name": "field1",
      "type": {
        "kind": "NON_NULL",
        "name": null,
        "ofType": {
          "kind": "SCALAR",
          "name": "String",
          "ofType": null
        }
      },
      "defaultValue": null
    },
    {
      "name": "field2",
      "type": {
        "kind": "SCALAR",
        "name": "String",
        "ofType": null
      },
      "defaultValue": null
    },
    {
      "name": "start",
      "type": {
        "kind": "SCALAR",
        "name": "String",
        "ofType": null
      },
      "defaultValue": null
    },
    {
      "name": "order",
      "description": "",
      "type": {
        "kind": "NON_NULL",
        "name": null,
        "ofType": {
          "kind": "ENUM",
          "name": "Sort",
          "ofType": null
        }
      },
      "defaultValue": "DESC"
    },
    {
      "name": "count",
      "type": {
        "kind": "NON_NULL",
        "name": null,
        "ofType": {
          "kind": "SCALAR",
          "name": "Int",
          "ofType": null
        }
      },
      "defaultValue": "20"
    }
  ],
  "interfaces": [],
  "enumValues": [],
  "possibleTypes": []
}

field2 and start both have default parameters when code is generated.

source: gharchive/issue

authors: AOrobator hameno sav007

repo: apollographql/apollo-android

license: MIT


text:
Add JS target to apollo-api module

First attempt to bring JS support in Kotlin Multiplatform.
One test is still failing due to some bugs in Kolin.Number in JS, I fixed some, and I'm still working on it, but I wanted to have early feedback.
Maybe the PR shouldn't be merged in master, but in some kind of epic/feature branch, like js-support

@omainegra: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Hi and thanks for looking into this 👍 . Looks like there's a lot of JS momentum 🙌  🙌 .
I hate to be the one saying that but another pull request was opened a few days ago about the same thing: https://github.com/apollographql/apollo-android/pull/2467.
Do you mind looking into it and see if it matches what you had in mind?

🤦 That's right, many of my changes are already there. One thing different is that in my case BigDecimal extends Number, but then I had to patch the generated js to fix the issue

FWIW I also added a workaround to the KClass<*>.qualifiedName in JS, then I did had to change so much code

Regarding qualifiedName2, I'd prefer to avoid adding the method in apollo-api since it's not strictly needed at runtime, it's only used for tests where we know in advance what the qualified name will be.
If that's ok with you, I'd like to merge #2467 in master since there's been some discussion there already. And then work in 3.x to remove BigDecimal. What do you think, any objection to merging #2467 ?

Please go ahead, it'd be nice to coordinate future efforts tho, there are still some modules to add JS support

authors: apollo-cla martinbonnin omainegra


text:
link specification incompatibility error with fedtest command

fedtest CLI creates supergraph.graphql with @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION)
Then router fails with Invalid supergraph: uses unsupported join spec version v0.3 (supported versions: v0.2, v0.1.
https://github.com/dotansimha/graphql-yoga/actions/runs/4173140505/jobs/7225119764#step:8:312
Rover version; v0.11.1
@apollo/federation-subgraph-compatibility version; 1.0.1
The command I use;
fedtest docker --compose ./docker-compose.yaml --schema ./schema.graphql --path /graphql --port 4001 --debug --format markdown -> https://github.com/dotansimha/graphql-yoga/pull/2436/files#diff-2a8444e25a7fde00cf23c11069f3ea869362685cd4918bfbe980c1522d340e52R12

Hello 👋
Thanks for raising this. In order to avoid those breaking changes in the future, I've pinned composition version within the script itself (see https://github.com/apollographql/apollo-federation-subgraph-compatibility/pull/353). I've released v1.1.0 with the changes.
Thanks,
Derek

Thank you for the fix!
But now it says No tests found.
https://github.com/dotansimha/graphql-yoga/actions/runs/4181145613/jobs/7242805471#step:8:364

@ardatan That is odd. Tests should be there
In /home/runner/work/graphql-yoga/graphql-yoga/node_modules/.pnpm/@apollo+federation-subgraph-compatibility-tests@1.1.0_wyaqim46cuthwo3oxpq6pvkvb4/node_modules/@apollo/federation-subgraph-compatibility-tests
  93 files checked.
  testMatch: **/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 24 matches
  testPathIgnorePatterns:  - 0 matches
  testRegex:  - 0 matches
Pattern: /home/runner/work/graphql-yoga/graphql-yoga/node_modules/.pnpm/@apollo+federation-subgraph-compatibility-tests@1.1.0_wyaqim46cuthwo3oxpq6pvkvb4/node_modules/@apollo/federation-subgraph-compatibility-tests/dist/tests - 0 matches

Based on the above it finds 24 matches using testMatch pattern (there are 12 test files which gets compiled to the corresponding *.test.d.ts and *.test.js files) but then it complains that it didn't find any tests under dist/tests. I'm confused - can you try it locally? Maybe it is something due to environment?
Latest release seems to work fine in federation-jvm and graphql-kotlin

authors: ardatan dariuszkuc


text:
using "await introspectSchema(...)" doesnt work

In the documentation for schema stitching here: https://www.apollographql.com/docs/graphql-tools/remote-schemas.html ...
There are examples that show the usage of const schema = await introspectSchema(link); however when compiling with typescript I get the following error:
error TS1308: 'await' expression is only allowed within an async function.
I'm using graphql-tools@2.14.1 and typescript@2.6.2

UPDATE! i was having a brainfart moment and realized i didnt have the await usage in an async'd function... however, i could see this causing issues with other people who are copy/pasting the example to try it out.

True! @stringbeans would you mind sending a quick PR to the docs with an improvement? Could be a great way to get a contribution going :]

The file's here BTW: https://github.com/apollographql/graphql-tools/blob/master/docs/source/remote-schemas.md

@stubailo will do! apologies, i should've probably just have done this from the get-go :)

authors: stringbeans stubailo

repo: apollographql/graphql-tools


text:
EXCEPTION: Error: Uncaught (in promise): No Pipe decorator found on ApolloQueryPipe

Hello,
I'm getting this error when I run the hello-world example:
EXCEPTION: Error: Uncaught (in promise): No Pipe decorator found on ApolloQueryPipe
Any idea how to fix this.
Thanks in advance

@iguissouma Are you using angular2-apollo with one of beta versions of angular2 or with release candidate? It's been tested on beta.

@kamilkisiela
I'm using angular2@2.0.0-beta.17, that's what i see on package.jon on node_modules\angular2:
"name": "angular2",
  "version": "2.0.0-beta.17",
  "description": "Angular 2 - a web framework for modern web apps",
  "homepage": "https://github.com/angular/angular",
  "bugs": {
    "url": "https://github.com/angular/angular/issues"
  }

Do I have to use 2.0.0-beta.15?

I got this error when I changed the location of the pipe.ts file.
My folder structure before was client >>

pipe.ts, app.ts

when I changed this to

client>>pipe>>pipe.ts
client>>app.ts

I got the error
EXCEPTION: Error: Uncaught (in promise): No Pipe decorator found on *pipeclass*

Could you try to use this #17 ?

Just released 0.1.0 that might solve it, can you try the new version and let me know if it works for you?

closing as I haven't got feedback

authors: Urigo bharath-cchmc iguissouma kamilkisiela


text:
Attaches connectors to mocked schema

Attaches connectors even if schema is (partially) mocked. Adds tests.

@helfer Travis failed with NVM installation issues. Can you resubmit the build please?

Thanks for this!

authors: helfer rdrey

repo: apollostack/apollo-server

license: mit

license_source: bigquery


text:
KGC data split

Hi Apoorv,
thank you for sharing the repo on KGT5. I am sorry for bothering you, but could you please tell me whether there is a link to the dataset split you used for the link prediction task and mentioned in the paper? I can't find it in previous issues + link from the repo leads to the dataset having the same number of connections as an original wikidata5m has.
Thank you in advance.

Hi @screemix and sorry for the delayed response
We used the same dataset split for wikidata5m that we have linked in the repo. Are you noticing any discrepancy? If so, please elaborate on the issue you are facing so we can better help

Do you require test/train split as well or just the mapping files?

Do you require test/train split as well or just the mapping files?

No, in this issue I meant actually the train/test split. I am sorry for misunderstanding.
Maybe I confused smt, but in the paper you wrote:

Following prior work (Sun et al., 2019a) we ran- domly drop 50% of edges from all KGs to simulate KG incompleteness. This stochasticity causes different works to have different KGs, making it hard to compare results without re-implementing methods. Ren et al. (2021) implemented all comparison methods using their own KG splits which they have

Did you split the train set to simulate KG incompleteness? And am I right that this is related to link prediction task? I am sorry if I confuse something, but this paragraph is separated from mentioning of the datasets used for both LP and QA tasks (section - 4.1 Datasets), so it isn't clear for me for which task you performed dropping. Would be great if you explain the procedure 'dropping 50% of connections' in more details.

The edge dropping thing was required for KGQA, since there is no official test/dev splits of the KG there.
For KGC, we used the same data split as used by other baselines

The edge dropping thing was required for KGQA, since there is no official test/dev splits of the KG there.
For KGC, we used the same data split as used by other baselines

Thank you for the clarification!

authors: apoorvumang screemix


text:
styles are always removed in browser

To Reproduce
It always happens in browserland. See this simple codesandbox:
https://codesandbox.io/s/festive-kirch-d1geou?file=/src/index.js
Original message is below but note this is not React-specific. -Tom
Original message
Step by step instructions to reproduce the behavior:

Create React App React 17
call this in first page

console.log(
    'html sanitizeHtml',
    sanitizeHtml('
test
', {
      allowedTags: sanitizeHtml.defaults.allowedTags.concat([
        'iframe',
        'img',
        'del',
        'ins',
      ]),
      allowedStyles: {
        p: {
          // Match HEX and RGB
          color: [
            /^.*$/i,
            /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,
          ],
        },
      },
      allowedAttributes: {
        '*': ['style'],
      },
    })
  );

Expected behavior

test

What i get

test

Describe the bug

the style attribute was removed

Details
"dependencies": {
    "@emotion/react": "^11.4.1",
    "@emotion/styled": "^11.6.0",
    "@mui/icons-material": "^5.4.1",
    "@mui/lab": "^5.0.0-alpha.71",
    "@mui/material": "^5.4.1",
    "@mui/styled-engine-sc": "^5.4.1",
    "@mui/x-data-grid": "^5.5.0",
    "date-fns": "^2.28.0",
    "froala-editor": "^4.0.9",
    "i18next": "^21.6.11",
    "react": "^17.0.2",
    "react-beautiful-dnd": "^13.1.0",
    "react-device-detect": "^2.1.2",
    "react-dom": "^17.0.2",
    "react-fast-compare": "^3.2.0",
    "react-froala-wysiwyg": "^4.0.9",
    "react-hook-form": "^7.26.1",
    "react-i18next": "^11.15.4",
    "react-router-dom": "^5.3.0",
    "react-router-hash-link": "^2.4.3",
    "sanitize-html": "^2.7.0",
    "sort-json": "^2.0.0"
  },

Interesting issue. We don't use sanitize-html in the browser ourselves and there's no indication of this problem server-side, so it could be a while before we look at it in-house.
So what I'd suggest is that you set up the simplest possible webpack project that imports sanitize-html and tests this out in vanilla JS browser-side, as a starting point and to make sure you have the latest of everything.
And before that, I'd sanity-check that your code doesn't also fail when added to our regular unit tests and run with node on the command line, as if that fails it has nothing specifically to do with the browser.

Hey @boutell i have create a simple codesanbox https://codesandbox.io/s/festive-kirch-d1geou?file=/src/index.js
When i made a simpe js file an run it directly with node it work correctly

OK thanks for clarifying the nature of the issue. So it is not related to React, it happens all the time in the browser. That may be helpful to other interested developers who use sanitize-html on the front end and wish to help debug this problem.

I also experienced the same behavior.
It seems to have occurred when I raised the react-scripts version from 4 to 5. I am investigating the cause as react-scripts depends on various libraries.

In the code, stringifyStyleAttributes would fail and go to catch block so the attribute got deleted
if (a === 'style') {
try {
const abstractSyntaxTree = postcssParse(name + ' {' + value + '}');
const filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);
            value = stringifyStyleAttributes(filteredAST);

            if (value.length === 0) {
              delete frame.attribs[a];
              return;
            }
          } catch (e) {
            delete frame.attribs[a];
            return;
          }
        }

In the code, stringifyStyleAttributes would fail and go to catch block so the attribute got deleted
if (a === 'style') { try { const abstractSyntaxTree = postcssParse(name + ' {' + value + '}'); const filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);
            value = stringifyStyleAttributes(filteredAST);

            if (value.length === 0) {
              delete frame.attribs[a];
              return;
            }
          } catch (e) {
            delete frame.attribs[a];
            return;
          }
        }

nanoid is not a function in browser

I proposed to add an option to patch this issue,
if (a === 'style' && options.processStyle)   and for options we set processStyle = false to bypass this issue. I don't have access to create branch and pull request though

Are you saying there are features that cannot work in the browser right
now? What would processStyle: false actually do? I'm a little unclear on
that.
Anyone can submit a PR. The procedure is to "fork" the project to your own
github (see the github page for the repo, there's a button for that). Then
github will invite you to create a PR from your repo to ours when you have
changes.
On Mon, May 2, 2022 at 11:42 PM Yau Lun Tang @.***>
wrote:

I proposed to add an option to patch this issue,
if (a === 'style' && options.processStyle) and for options we set
processStyle = false to bypass this issue. I don't have access to create
branch and pull request though
—
Reply to this email directly, view it on GitHub
https://github.com/apostrophecms/sanitize-html/issues/547#issuecomment-1115685290,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAH27LGH7IDIUTX5A5CZBTVICODVANCNFSM5TQNA7IQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his

Are you saying there are features that cannot work in the browser right now? What would processStyle: false actually do? I'm a little unclear on that. Anyone can submit a PR. The procedure is to "fork" the project to your own github (see the github page for the repo, there's a button for that). Then github will invite you to create a PR from your repo to ours when you have changes.
…
On Mon, May 2, 2022 at 11:42 PM Yau Lun Tang @.> wrote: I proposed to add an option to patch this issue, if (a === 'style' && options.processStyle) and for options we set processStyle = false to bypass this issue. I don't have access to create branch and pull request though — Reply to this email directly, view it on GitHub <#547 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27LGH7IDIUTX5A5CZBTVICODVANCNFSM5TQNA7IQ . You are receiving this because you were mentioned.Message ID: @.>
-- THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

Looks like there are some dependencies that rely on node only. Browser won't work with those modules. processStyle: false means that it will not try to sanitize or remove the style attribute. I downloaded and modify the code locally and tried and it can workaround the problem.

I see. So right now if the style attribute is permitted we immediately
begin using the problematic feature?
Wouldn't it make more sense if the problematic feature was not even part of
the build, if it can't work outside of Node?
We don't use sanitize-html in the browser here (it's usually a mistake
since you can't ever trust the browser anyway; yes there are some edge
cases like using it for output rather than input). So that is work is
unlikely to happen on our end, but just asking what you think would be most
ideal if it were possible.
On Tue, May 3, 2022 at 10:42 AM Yau Lun Tang @.***>
wrote:

Are you saying there are features that cannot work in the browser right
now? What would processStyle: false actually do? I'm a little unclear on
that. Anyone can submit a PR. The procedure is to "fork" the project to
your own github (see the github page for the repo, there's a button for
that). Then github will invite you to create a PR from your repo to ours
when you have changes.
… <#m_5323872795942038585_>
On Mon, May 2, 2022 at 11:42 PM Yau Lun Tang @.> wrote: I proposed to
add an option to patch this issue, if (a === 'style' &&
options.processStyle) and for options we set processStyle = false to bypass
this issue. I don't have access to create branch and pull request though —
Reply to this email directly, view it on GitHub <#547 (comment)
https://github.com/apostrophecms/sanitize-html/issues/547#issuecomment-1115685290>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAH27LGH7IDIUTX5A5CZBTVICODVANCNFSM5TQNA7IQ
https://github.com/notifications/unsubscribe-auth/AAAH27LGH7IDIUTX5A5CZBTVICODVANCNFSM5TQNA7IQ
. You are receiving this because you were mentioned.Message ID: @.>
-- THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS |
apostrophecms.com | he/him/his
Looks like there are some dependencies that rely on node only. Browser
won't work with those modules. processStyle: false means that it will not
try to sanitize or remove the style attribute. I downloaded and modify the
code locally and tried and it can workaround the problem.
—
Reply to this email directly, view it on GitHub
https://github.com/apostrophecms/sanitize-html/issues/547#issuecomment-1116182717,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAH27P4XUBJ4HPOWRUVGTTVIE3OPANCNFSM5TQNA7IQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his

I see. So right now if the style attribute is permitted we immediately begin using the problematic feature? Wouldn't it make more sense if the problematic feature was not even part of the build, if it can't work outside of Node? We don't use sanitize-html in the browser here (it's usually a mistake since you can't ever trust the browser anyway; yes there are some edge cases like using it for output rather than input). So that is work is unlikely to happen on our end, but just asking what you think would be most ideal if it were possible. On Tue, May 3, 2022 at 10:42 AM Yau Lun Tang @.> wrote:
…
Are you saying there are features that cannot work in the browser right now? What would processStyle: false actually do? I'm a little unclear on that. Anyone can submit a PR. The procedure is to "fork" the project to your own github (see the github page for the repo, there's a button for that). Then github will invite you to create a PR from your repo to ours when you have changes. … <#m_5323872795942038585_> On Mon, May 2, 2022 at 11:42 PM Yau Lun Tang @.> wrote: I proposed to add an option to patch this issue, if (a === 'style' && options.processStyle) and for options we set processStyle = false to bypass this issue. I don't have access to create branch and pull request though — Reply to this email directly, view it on GitHub <#547 (comment) <#547 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27LGH7IDIUTX5A5CZBTVICODVANCNFSM5TQNA7IQ https://github.com/notifications/unsubscribe-auth/AAAH27LGH7IDIUTX5A5CZBTVICODVANCNFSM5TQNA7IQ . You are receiving this because you were mentioned.Message ID: @.> -- THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his Looks like there are some dependencies that rely on node only. Browser won't work with those modules. processStyle: false means that it will not try to sanitize or remove the style attribute. I downloaded and modify the code locally and tried and it can workaround the problem. — Reply to this email directly, view it on GitHub <#547 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27P4XUBJ4HPOWRUVGTTVIE3OPANCNFSM5TQNA7IQ . You are receiving this because you were mentioned.Message ID: @.**>
-- THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

I think it is better to use the feature (sanitize style attribute) by default and have an optional parameter to turn it off.
I am trying to make a website that can preview html tags and output it solely in the client side and this sanitize-html module is a perfect fit for me to use in the client side.

My concern is that it sounds like the build of this module that you wind up with in the browser probably has a lot of weight for a feature that doesn't even work in the browser, no? Not that this is a use case I'm personally concerned with, but I might be if I were in your position. I do understand that you're using sanitize html for output rather than input in the browser, which can be secure.

I too am experiencing this and would like to see it fixed if we can!

I'm getting the same issue trying to sanitize HTML for output. I'll see if i have some time to dig and file a PR

For anyone who is facing the issue in a CRA repo, one workaround is to eject from CRA and add the cjs support, e.g.,
https://github.com/facebook/create-react-app/pull/12021/files#diff-8e25c4f6f592c1fcfc38f0d43d62cbd68399f44f494c1b60f0cf9ccd7344d697R467, another workaround is to customize the webpack configuration via react-app-wired, e.g., https://github.com/facebook/create-react-app/pull/12021#issuecomment-1108426483.
See https://github.com/facebook/create-react-app/pull/12021 for detail.

We have an issue when we use styles with "placeholders."  The previous version only checked the "style" tag and did not validate the style tag's contents.
Example:
Test
Please also consider this use case for adding a disable flag.
Can you please recommend which version style values are validated?  We want to return to the latest version without validation until there is a way to skip validating the style values.

Same here. Please, can someone look into this - kind of a blocker for using this package in the browser

yup, nanoid used inside postcssParse is causing issue when used in browser

They're not wrong (: We have always felt that the use of this module on the browser side is a little bit crazy, since you can never trust a browser anyway, although I accept there's an edge case where you use it for output of otherwise untrusted input... even though that is unnecessary overhead... on every single render! Sanitization and servers go together like bread and jam.

PR to add an option to disable style parsing has been opened: https://github.com/apostrophecms/sanitize-html/pull/596

Hi everyone (@boutell  and @bertyhell) - Thank you for the PR!!! I wanted to note that this solves the browser use case, but we also have a use case in nodeJS because our application uses "placeholders" in the styles.  So the addition of the new flag makes sense for a few valid use cases.
Our example:

Test

Is this PR expected to be included in the next release?  We'd love to upgrade.

At last count this was nearly through, I had asked for a couple
documentation revisions on the PR.
On Mon, Jan 16, 2023 at 10:03 PM mattweberio @.***>
wrote:

Hi everyone @.*** https://github.com/boutell and @bertyhell
https://github.com/bertyhell) - Thank you for the PR!!! I wanted to
note that this solves the browser use case, but we also have a use case in
nodeJS because our application uses "placeholders" in the styles. So the
addition of the new flag makes sense for a few valid use cases.
Our example:
Test
Is this PR expected to be included in the next release? We'd love to
upgrade.
—
Reply to this email directly, view it on GitHub
https://github.com/apostrophecms/sanitize-html/issues/547#issuecomment-1384775475,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAH27OBP7JB36W6OQWV2NDWSYDXLANCNFSM5TQNA7IQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his

yes, i need to tweak the docs a little, i'll put a reminder for this evening to take a look

They're not wrong (: We have always felt that the use of sanitize-html on the browser side is a little bit crazy, since you can never trust a browser anyway, although I accept there's an edge case where you use it for output of otherwise untrusted input... even though that is unnecessary overhead... on every single render! Sanitization and servers go together like bread and jam.

@boutell just as FYI there are applications which do not have a Node server at all but use sanitize-html on the browser side, for example JupyterLab and Notebook use it because a user might open a notebook with an untrusted HTML. Thank you for your work here!

authors: AlexSCorey Julian-B90 NishantDesai1306 bertyhell boutell edolix krassowski kyoncy mattweberio shinxi slavco86 yauluntang

repo: apostrophecms/sanitize-html


text:
[ArgumentError] too few arguments in ruby 2.3.1

Hi guys,
I am struggling with this after upgrading ruby to 2.3.1 (Rails 4.2.6. Reform gem 1.2.0, I know it's old).
Is there a way to make it works without strong impact?
 Failure/Error: form.save

 ArgumentError:
   too few arguments
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:81:in `format'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:81:in `block in get'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:100:in `evaluate_option'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:80:in `get'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:37:in `block in compile_fragment'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:100:in `evaluate_option'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/binding.rb:36:in `compile_fragment'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/mapper.rb:64:in `compile_fragment'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/mapper.rb:30:in `serialize_property'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/mapper.rb:22:in `block in serialize'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/mapper.rb:21:in `each'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/mapper.rb:21:in `serialize'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable.rb:41:in `create_representation_with'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-2.1.8/lib/representable/hash.rb:35:in `to_hash'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-1.2.6/lib/reform/form/sync.rb:81:in `sync_hash'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-1.2.6/lib/reform/form/sync.rb:94:in `sync_hash'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-1.2.6/lib/reform/form/sync.rb:15:in `sync!'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-1.2.6/lib/reform/form/sync.rb:6:in `sync_models'
 # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-1.2.6/lib/reform/form/save.rb:7:in `save'
 # ./app/services/appointment_creator.rb:12:in `perform'

Why such an old version of Reform? Shouldn't we rather upgrade?

@apotonick started upgrading, mate.. many issues. Reform 2.0.0 for starting.
At this moment: NoMethodError: private method `binding' called for {}:Hash when invoking form.validate(parameters) method.

Go straight to Reform 2.2, bro, and Representable 3.0! https://gitter.im/trailblazer/chat

Eventually I will, the problem is the breaking changes all over the application. For instance, validate method has replaced update! entirely?

Now reform 2.2.1 specs breaking.
ruby-2.3.1/gems/reform-2.2.1/lib/reform/validation.rb:6:in `validation_groups': undefined local variable or method `validation_group_class'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/validation.rb:13:in `validation'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/validation.rb:19:in `validates'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/contract.rb:24:in `property'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/form.rb:19:in `property'
	from /Users/emersonxavier/Code/neptune/app/forms/admin/expense_payment_type_form.rb:3:in `<class:ExpensePaymentTypeForm>'
	from /Users/emersonxavier/Code/neptune/app/forms/admin/expense_payment_type_form.rb:2:in `<module:Admin>'
	from /Users/emersonxavier/Code/neptune/app/forms/admin/expense_payment_type_form.rb:1:in `<top (required)>'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:360:in `require_or_load'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:494:in `load_missing_constant'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:184:in `const_missing'
	from /Users/emersonxavier/Code/neptune/spec/forms/admin/expense_payment_type_form_spec.rb:3:in `<top (required)>'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
	from /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'

Now I couldn't go on with this one:
Failure/Error: if @form.validate(params)
     NoMethodError:
       undefined method `call' for Date:Class
       Did you mean?  caller
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/disposable-0.3.2/lib/disposable/twin/coercion.rb:20:in `block (2 levels) in coercing_setter!'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/deserializer.rb:91:in `block in <module:Representable>'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/pipeline.rb:18:in `evaluate'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/pipeline.rb:10:in `block in call'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/pipeline.rb:9:in `each'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/pipeline.rb:9:in `inject'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/pipeline.rb:9:in `call'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/binding.rb:37:in `uncompile_fragment'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable.rb:52:in `block in call'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable.rb:50:in `each'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable.rb:50:in `call'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable.rb:69:in `representable_map!'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable.rb:36:in `update_properties_from'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/hash/allow_symbols.rb:10:in `update_properties_from'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/representable-3.0.0/lib/representable/hash.rb:30:in `from_hash'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/form/validate.rb:28:in `deserialize'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/reform-2.2.1/lib/reform/form/validate.rb:21:in `validate'
     # ./app/controllers/placements/next_post_placement_schedule_controller.rb:13:in `update'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:198:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/metal/rendering.rb:10:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:117:in `call'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:505:in `call'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/metal/rescue.rb:29:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/activerecord-4.2.6/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/abstract_controller/base.rb:137:in `process'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionview-4.2.6/lib/action_view/rendering.rb:30:in `process'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/test_case.rb:639:in `process'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/test_case.rb:67:in `process'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/central-1.0.1/lib/central/test_helpers.rb:19:in `block in process'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/central-1.0.1/lib/central/test_helpers.rb:69:in `catch'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/central-1.0.1/lib/central/test_helpers.rb:69:in `_catch_warden'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/central-1.0.1/lib/central/test_helpers.rb:19:in `process'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/test_case.rb:526:in `patch'
     # /Users/emersonxavier/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.6/lib/action_controller/test_case.rb:550:in `xml_http_request'
     # ./spec/controllers/placements/next_post_placement_schedule_controller_spec.rb:40:in `block (3 levels) in <top (required)>'

Coercion now needs dry-types! http://trailblazer.to/gems/reform/options.html#coercion

Have you checked out http://trailblazer.to/gems/reform/upgrading-guide.html ?

@apotonick Have you already dropped support for reform 1.2?

Of course, it's a few years old. I can offer you upgrading support: http://trailblazer.to/inc/help.html

I'm going to close this as we no longer provide support for such an old version of Reform. I hope that you have managed to resolve your issue. If not try the gitter channel or take @apotonick up on his offer.

authors: apotonick fran-worley msxavi

repo: apotonick/reform


text:
file: cleanup tmpDir

I got tired of my /tmp filling up.  So lets not fill it up.

oooer, thanks. lgtm

authors: jonboulle pquerna


text:
Q: ETA for 6.0?

It seems that a 6.0 release was planned (with nullable reference types). Is there an ETA for it?

Yes, there is a branch with what could be V6. The only change is that nullable-reference types are supported. The problem is that it introduces a lot of breaking changes to the API. So, up to now, I was not convinced that it should be released. You are the first to ask for it :-)

@ursenzler No need to hurry, especially if you don't like the breaking changes for 6.0 😉 .

authors: fubar-coder ursenzler

repo: appccelerate/statemachine


text:
Problem with com.danielcwilson.plugins.googleanalytics along with com.admob.google 4.0.7

When I added
com.admob.google 4.0.7
and
com.danielcwilson.plugins.googleanalytics
to my project after execution of $cordova build I get the following error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/analytics/internal/Command$1;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
:dexDebug FAILED
I found out that this is a problem with multiple dependency, but can I solve this in anyway?
Thanks!

Here is stackoverflow post that shows workaround for this issue: http://stackoverflow.com/questions/31451872/cordova-com-danielcwilson-plugins-googleanalytics-with-com-admob-google

You can also use our analytics plugin which has no conflict with this one:
cordova plugin add cordova-plugin-analytics

And if you would like to use adId:
cordova plugin add cordova-plugin-analytics-adid

authors: appfeel tscislo

repo: appfeel/admob-google-cordova


text:
strike_expandableSection component

Salesforce added a lightning:accordion and lightning:accordionSection in Winter 18. However, these do now allow for a single section to be expanded/collapsed. It would be great if we also had an implementation of the expandable section.

at the moment we don't have this on our radar. however, we will be adding a fiddler for the accordion soon. closing for now with the possibility that we'll implement such a component in the future.

No worries. Our team is considering developing this component for our internal use. If we choose to do so do you think this aligns with what Strike is trying to offer? (If so I would open a PR).

@dsharrison first off thanks for using Strike and your support. Since Strike came out of our need for components in our client work that is always our test for adding a new component. As of now we have not come across any use cases that need a more sophisticated accordion than for our clients than what Salesforce's base accordion component offers (not to say this may not happen in the future). We have not done PRs on entire components to-date because we are trying to be very conscious of the time required to maintain the existing set. The components we have written all follow similar patterns which helps when maintaining them. Our main fear around doing a PR on a component that we have not written is that it would just be different enough from the rest that it would make maintaining the whole set more complicated. We would be happy to consider your PR but you may try and pattern is after other components we have written to increase the likely hood of us being able to pull it in. Hope that helps.

authors: daneowens3 dsharrison georgekenessey

repo: appiphony/Strike-Components


text:
Relax jax version in dependencies.

Copy of https://github.com/apple/axlearn/pull/204 which seems to be stuck processing updates.

Looks like an ongoing github incident... https://www.githubstatus.com/

repo: apple/axlearn


text:
UNIXv7, VSC: /tset/POSIX.cmd/lp/lp.ex:36 FAILs

According to UNIXv7 standard all POSIX compliant utilities must be able to
accept groupped options.
Solaris lp says:
$ echo "0123456789 lp Assertion 36" >lp_in_1
$ lp -c -n 2 -d printer1 lp_in_1; echo $?
request id is printer1-32 (1 file(s))
0
$ lp -cn 2 -d printer1 lp_in_1; echo $?
lp: Error - unable to access "2" - No such file or directory
1

Fix for the above bug is as follows.
+--- systemv/lp.c	Wed Mar 23 11:59:25 2016
++++ systemv/lp.c	Fri Mar 25 22:52:26 2016
+@@ -39,7 +39,87 @@

int	set_job_attrs(const char *command, int job_id, int num_options,

            cups_option_t *options);

++/*
++ * Transform combined arguments into separate list so that the option
++ * handling in main() can handle those properly.
++ * For example:
++ *	lp -U user -csdprinter file1
++ * would be converted to
++ *	lp -U user -c -s -dprinter file
++ *
++ * The logic used to determine the end of option is same as in main(),
++ * so that option handling in main() wouldn't upset.
++ */
++static int
++parseargs(int *acp, char **avp[])
++{
++	int	c, i, j;
++	int	argc, ac, eos;
++	char	**argv, **av;
++	int	end_options = 0;
+
++	argc = *acp;
++	argv = *avp;
++
++	j = argc + 1;
++	for (i = 1; i < argc; i++) {
++    		if (argv[i][0] == '-')
++			j += strlen(argv[i]);
++	}
++	if ((av = malloc(sizeof (char ) * j)) == NULL)
++		return (1);
++
++	av[0] = argv[0];
++	ac = 1;
++	for (i = 1; i < argc; i++) {
++    		if (end_options || argv[i][0] != '-' || argv[i][1] == '\0') {
++			av[ac++] = argv[i];
++			continue;
++		}
++		eos = 0;
++		for (j = 1; (c = argv[i][j]) != '\0'; j++) {
++			switch (c) {
++			case 'U': case 'd': case 'f': case 'h':
++			case 'i': case 'n': case 'o': case 'p':
++			case 'q': case 't': case 'y': case 'H':
++			case 'P': case 'S': case 'T':
++				/ take option argument /
++				(void) asprintf(&av[ac], "-%s", &argv[i][j]);
++				ac++;
++				/ option argument may be on the next /
++				if (argv[i][j + 1] == '\0') {
++					/ copy only if it's available /
++					if ((i + 1) < argc)
++						av[ac++] = argv[++i];
++				}
++				eos = 1;
++				break;
++			case '-':
++				av[ac++] = argv[i];
++				end_options = 1;
++				eos = 1;
++				break;
++			default:
++				(void) asprintf(&av[ac], "-%c", c);
++				ac++;
++				break;
++			}
++			if (eos)
++				break;
++		}
++	}
++	av[ac] = NULL;
++	for (i = 1; i < ac; i++) {
++		/ asprintf might have failed with ENOMEM */
++		if (av[i] == NULL)
++			return (1);
++	}
++
++	*acp = ac;
++	*avp = av;
++	return (0);
++}
++

/*

'main()' - Parse options and send files for printing.

*/
+@@ -65,6 +145,10 @@
int		silent;			/* Silent or verbose output? */
char		buffer[8192];		/* Copy buffer */

++  if (parseargs(&argc, &argv)) {
++    _cupsLangPrintf(stderr, _("Unable to allocate memory!"));
++    return (1);
++  }
+

#ifdef __sun
/*

Patch for above bug fix is as follows.
+--- systemv/lp.c	Wed Mar 23 11:59:25 2016
++++ systemv/lp.c	Fri Mar 25 22:52:26 2016
+@@ -39,7 +39,87 @@

int	set_job_attrs(const char *command, int job_id, int num_options,

            cups_option_t *options);

++/*
++ * Transform combined arguments into separate list so that the option
++ * handling in main() can handle those properly.
++ * For example:
++ *	lp -U user -csdprinter file1
++ * would be converted to
++ *	lp -U user -c -s -dprinter file
++ *
++ * The logic used to determine the end of option is same as in main(),
++ * so that option handling in main() wouldn't upset.
++ */
++static int
++parseargs(int *acp, char **avp[])
++{
++	int	c, i, j;
++	int	argc, ac, eos;
++	char	**argv, **av;
++	int	end_options = 0;
+
++	argc = *acp;
++	argv = *avp;
++
++	j = argc + 1;
++	for (i = 1; i < argc; i++) {
++    		if (argv[i][0] == '-')
++			j += strlen(argv[i]);
++	}
++	if ((av = malloc(sizeof (char ) * j)) == NULL)
++		return (1);
++
++	av[0] = argv[0];
++	ac = 1;
++	for (i = 1; i < argc; i++) {
++    		if (end_options || argv[i][0] != '-' || argv[i][1] == '\0') {
++			av[ac++] = argv[i];
++			continue;
++		}
++		eos = 0;
++		for (j = 1; (c = argv[i][j]) != '\0'; j++) {
++			switch (c) {
++			case 'U': case 'd': case 'f': case 'h':
++			case 'i': case 'n': case 'o': case 'p':
++			case 'q': case 't': case 'y': case 'H':
++			case 'P': case 'S': case 'T':
++				/ take option argument /
++				(void) asprintf(&av[ac], "-%s", &argv[i][j]);
++				ac++;
++				/ option argument may be on the next /
++				if (argv[i][j + 1] == '\0') {
++					/ copy only if it's available /
++					if ((i + 1) < argc)
++						av[ac++] = argv[++i];
++				}
++				eos = 1;
++				break;
++			case '-':
++				av[ac++] = argv[i];
++				end_options = 1;
++				eos = 1;
++				break;
++			default:
++				(void) asprintf(&av[ac], "-%c", c);
++				ac++;
++				break;
++			}
++			if (eos)
++				break;
++		}
++	}
++	av[ac] = NULL;
++	for (i = 1; i < ac; i++) {
++		/ asprintf might have failed with ENOMEM */
++		if (av[i] == NULL)
++			return (1);
++	}
++
++	*acp = ac;
++	*avp = av;
++	return (0);
++}
++

/*

'main()' - Parse options and send files for printing.

*/
+@@ -65,6 +145,10 @@
int		silent;			/* Silent or verbose output? */
char		buffer[8192];		/* Copy buffer */

++  if (parseargs(&argc, &argv)) {
++    _cupsLangPrintf(stderr, _("Unable to allocate memory!"));
++    return (1);
++  }
+

#ifdef __sun
/*
``

Bug fix is as follows.
`+--- systemv/lp.c	Wed Mar 23 11:59:25 2016
++++ systemv/lp.c	Fri Mar 25 22:52:26 2016
+@@ -39,7 +39,87 @@

int	set_job_attrs(const char *command, int job_id, int num_options,

            cups_option_t *options);

++/*
++ * Transform combined arguments into separate list so that the option
++ * handling in main() can handle those properly.
++ * For example:
++ *	lp -U user -csdprinter file1
++ * would be converted to
++ *	lp -U user -c -s -dprinter file
++ *
++ * The logic used to determine the end of option is same as in main(),
++ * so that option handling in main() wouldn't upset.
++ */
++static int
++parseargs(int *acp, char **avp[])
++{
++	int	c, i, j;
++	int	argc, ac, eos;
++	char	**argv, **av;
++	int	end_options = 0;
+
++	argc = *acp;
++	argv = *avp;
++
++	j = argc + 1;
++	for (i = 1; i < argc; i++) {
++    		if (argv[i][0] == '-')
++			j += strlen(argv[i]);
++	}
++	if ((av = malloc(sizeof (char ) * j)) == NULL)
++		return (1);
++
++	av[0] = argv[0];
++	ac = 1;
++	for (i = 1; i < argc; i++) {
++    		if (end_options || argv[i][0] != '-' || argv[i][1] == '\0') {
++			av[ac++] = argv[i];
++			continue;
++		}
++		eos = 0;
++		for (j = 1; (c = argv[i][j]) != '\0'; j++) {
++			switch (c) {
++			case 'U': case 'd': case 'f': case 'h':
++			case 'i': case 'n': case 'o': case 'p':
++			case 'q': case 't': case 'y': case 'H':
++			case 'P': case 'S': case 'T':
++				/ take option argument /
++				(void) asprintf(&av[ac], "-%s", &argv[i][j]);
++				ac++;
++				/ option argument may be on the next /
++				if (argv[i][j + 1] == '\0') {
++					/ copy only if it's available /
++					if ((i + 1) < argc)
++						av[ac++] = argv[++i];
++				}
++				eos = 1;
++				break;
++			case '-':
++				av[ac++] = argv[i];
++				end_options = 1;
++				eos = 1;
++				break;
++			default:
++				(void) asprintf(&av[ac], "-%c", c);
++				ac++;
++				break;
++			}
++			if (eos)
++				break;
++		}
++	}
++	av[ac] = NULL;
++	for (i = 1; i < ac; i++) {
++		/ asprintf might have failed with ENOMEM */
++		if (av[i] == NULL)
++			return (1);
++	}
++
++	*acp = ac;
++	*avp = av;
++	return (0);
++}
++

/*

'main()' - Parse options and send files for printing.

*/
+@@ -65,6 +145,10 @@
int		silent;			/* Silent or verbose output? */
char		buffer[8192];		/* Copy buffer */

++  if (parseargs(&argc, &argv)) {
++    _cupsLangPrintf(stderr, _("Unable to allocate memory!"));
++    return (1);
++  }
+

#ifdef __sun
/*
`

Patch for bug fix as follows.
+--- systemv/lp.c	Wed Mar 23 11:59:25 2016
++++ systemv/lp.c	Fri Mar 25 22:52:26 2016
+@@ -39,7 +39,87 @@

int	set_job_attrs(const char *command, int job_id, int num_options,

            cups_option_t *options);

++/*
++ * Transform combined arguments into separate list so that the option
++ * handling in main() can handle those properly.
++ * For example:
++ *	lp -U user -csdprinter file1
++ * would be converted to
++ *	lp -U user -c -s -dprinter file
++ *
++ * The logic used to determine the end of option is same as in main(),
++ * so that option handling in main() wouldn't upset.
++ */
++static int
++parseargs(int *acp, char **avp[])
++{
++	int	c, i, j;
++	int	argc, ac, eos;
++	char	**argv, **av;
++	int	end_options = 0;
+
++	argc = *acp;
++	argv = *avp;
++
++	j = argc + 1;
++	for (i = 1; i < argc; i++) {
++    		if (argv[i][0] == '-')
++			j += strlen(argv[i]);
++	}
++	if ((av = malloc(sizeof (char ) * j)) == NULL)
++		return (1);
++
++	av[0] = argv[0];
++	ac = 1;
++	for (i = 1; i < argc; i++) {
++    		if (end_options || argv[i][0] != '-' || argv[i][1] == '\0') {
++			av[ac++] = argv[i];
++			continue;
++		}
++		eos = 0;
++		for (j = 1; (c = argv[i][j]) != '\0'; j++) {
++			switch (c) {
++			case 'U': case 'd': case 'f': case 'h':
++			case 'i': case 'n': case 'o': case 'p':
++			case 'q': case 't': case 'y': case 'H':
++			case 'P': case 'S': case 'T':
++				/ take option argument /
++				(void) asprintf(&av[ac], "-%s", &argv[i][j]);
++				ac++;
++				/ option argument may be on the next /
++				if (argv[i][j + 1] == '\0') {
++					/ copy only if it's available /
++					if ((i + 1) < argc)
++						av[ac++] = argv[++i];
++				}
++				eos = 1;
++				break;
++			case '-':
++				av[ac++] = argv[i];
++				end_options = 1;
++				eos = 1;
++				break;
++			default:
++				(void) asprintf(&av[ac], "-%c", c);
++				ac++;
++				break;
++			}
++			if (eos)
++				break;
++		}
++	}
++	av[ac] = NULL;
++	for (i = 1; i < ac; i++) {
++		/ asprintf might have failed with ENOMEM */
++		if (av[i] == NULL)
++			return (1);
++	}
++
++	*acp = ac;
++	*avp = av;
++	return (0);
++}
++

/*

'main()' - Parse options and send files for printing.

*/
+@@ -65,6 +145,10 @@
int		silent;			/* Silent or verbose output? */
char		buffer[8192];		/* Copy buffer */

++  if (parseargs(&argc, &argv)) {
++    _cupsLangPrintf(stderr, _("Unable to allocate memory!"));
++    return (1);
++  }
+

#ifdef __sun
/*

Um, OK, we definitely will not take that change as provided...
We can probably just pull the option handling code from the newer (non-system-V) commands since they do handle combination of options.
However, I will note that the original System V and Berkeley printing commands do not support this and their original syntax is NOT part of POSIX.2, so we'll need to be careful about doing this - the 'd' option in particular needs to allow "-dqueuename" for backwards compatibility, as do the 'n' (copies), 'o' (option), 'p' (priority), and 't' (title) options.

[master bdbfacc] Support POSIX option processing (Issue #4813)

authors: Srikanthpandrahalli michaelrsweet

repo: apple/cups


text:
Inability to set printer attribute job-password

Hi,
I'm working on a printer service and i'm trying to access a printers' (Canon) SECURE PRINT function by setting these attributes
 attributeMap["job-attributes"] = "job-password:octetString:123#job-password-encryption:keyword:none";
I get this error at CUPS admin (ver 2.2.12) when i try to print
"src = job.c, line = 1385, log = none of secured print password and username"
When i check /var/spool/cups i can see all the attributes set except from job-password attribute hence the error.
Please help.
Error at CUPS

/var/spool/cups

@gitneo How are you specifying the job-password value on the CUPS client?
What version of CUPS are you using?
What operating system is the client using?

Hi,
I'm using
CUPS 2.2.12.
The client operating system
NAME="Oracle Linux Server"
VERSION="7.5"
job-password specification on client,
job-password:octetString:12345
The complete line of code includes the job-password-encryption and requesting-user-name.
printAttributes["job-attributes"] =
      "job-password:octetString:12345#job-password-encryption:keyword:none#requesting-user-name:name:GITNEO";

@gitneo I'm not sure how you are submitting jobs, as the code you are including is NOT the CUPS API.
But I can guess from the context that you are passing job-password and job-password-encryption in the job-attributes group, but they MUST be provided in the operation attributes group. They are security attributes and not part of the job ticket...

authors: gitneo michaelrsweet


text:
Preserving comments on pkl eval

I have a PKL template configuration file, and I'd like to ensure that comments are preserved after pkl eval, as the output is the user-facing configuration file. Is there a way to retain the comments in the generated document on pkl eval?

As far as I know, this isn’t currently supported.
How would you like comments to be propagated from the Pkl template to the (YAML?) output?
Should this only happen for top-level properties to avoid duplicated comments?

I think similar to how dynamic objects are not supported in other template format. The process can also strip comments on selected output.

Something that you can do quite easily is to add top-level comments to a document, like so:
output {
  text = """
    // This is a rendered file! DO NOT EDIT
    \(super.text)
    """
}

But it's much less trivial if you want comments interspersed throughout the rendered file; most comments (line comments and block comments) are treated as whitespace and thrown away.
However, doc comments can be obtained through reflection:
/// Here are my doc comments
module myModule

import "pkl:reflect"

local mod = reflect.Module(module)

myDocComments = mod.docComment

This produces:
myDocComments = "Here are my doc comments"

Our code generators for Swift and Go are written in Pkl, and use reflection to obtain these doc comments, which then get rendered as comments in the target language. E.g.
https://github.com/apple/pkl-go/blob/18676a5e876c90600b8058ffb489fa8148e7869d/codegen/src/internal/ClassGen.pkl#L186-L188
https://github.com/apple/pkl-swift/blob/44a04408df3ecffde883900e0df905950fe9db0c/codegen/src/internal/ClassGen.pkl#L144-L147

authors: bioball jjuliano translatenix

repo: apple/pkl


text:
Missing Version Number in Documentation

Missing Version Number

Thanks for fixing this!

authors: FranzBusch leogdion

repo: apple/swift-async-algorithms


text:
Merge darwin/trunk, including libdispatch-703.1.4 Apple source drop, to swift-3.0-branch

Merge tag darwin/darwin-006 on darwin/trunk, which includes the latest Apple source drop libdispatch-703.1.4 as well as with all the github PR’s that we’ve pulled back into our internal repository since the last darwin/trunk merge, along with any changes made to these during internal review and testing on Darwin.

@swift-ci Please test

@swift-ci Please test

@RLovelett that seems like a complaint about https://github.com/apple/swift-corelibs-libdispatch/pull/139 and not this PR ? that flag was introduced there

tl;dr I did not intend to bring the nitpick up in this PR. In fact, I didn't know it even existed when I wrote my comment. 😄
@das you are right. I wrote the comment on the line of code in the change for #139 (specifically https://github.com/apple/swift-corelibs-libdispatch/commit/b65aa22fbd84907a9f3d570e695cb0b3e482a1a3).
GitHub pulls comments on lines of code in the comments section for a PR. Because you are pulling to a new branch that contains a commit (https://github.com/apple/swift-corelibs-libdispatch/commit/b65aa22fbd84907a9f3d570e695cb0b3e482a1a3) that I commented on GitHub brought the comment into this PR thread.
I certainly do not intend to have my nitpick slow-down the swift-3.0-branch.
Sorry for the trouble. 🖖

@RLovelett: no problem, thanks

@swift-ci Please test

authors: RLovelett das

repo: apple/swift-corelibs-libdispatch


text:
Add support for UnsafeRawBufferPointer to DispatchData

(Radar 30699743)

@swift-ci please test

What about withUnsafeBytes and enumerateBytes? Seems they should also both be using UnsafeRawBufferPointer

What about withUnsafeBytes and enumerateBytes? Seems they should also both be using UnsafeRawBufferPointer

It's a deliberate choice to not add support for UnsafeRawBufferPointer to the enumerateBytes and withUnsafeBytes methods at this time. Adding a variant of either method that accepts an UnsafeRawBufferPointer argument creates an ambiguity at the call site when writing the closure, unless the user explicitly writes the type of the buffer argument. In a later release, we plan to add better APIs to both the DispatchData and the Foundation Data class.

@swift-ci please test

Updated for review comments. The API-related comments are deferred until later, pending further discussion with Foundation.

@swift-ci please test

shouldnt you also fix this too?
public func copyBytes(to buffer: UnsafeMutableBufferPointer, from range: CountableRange? = nil) -> Int

authors: karwa ktopley-apple phausler shahmishal


text:
Readying actors should not be arbitrarily called many times

https://github.com/apple/swift-distributed-actors/issues/885
We had some bugs about actor ready being called many times by the compiler, and this should have been fixed by now

resolves https://github.com/apple/swift-distributed-actors/issues/885

repo: apple/swift-distributed-actors


text:
Incorrect error reporting on older topic-style symbol reference that isn't used in code or documentation markdown

Description
WIth the Swift 5.9 updates to DocC that change the symbols to allow full unicode character support, I've updated my documentation - but am continuing to get warnings about incorrect symbols. I'm opening this issue per a discussion on the swift forums.
The example that shows this is MeshGenerator, and a perfect example is the symbol TextureCoordinates/_=(_:_:)-38jci.
The kind of warning that is displayed (in both Xcode and from DocC on the command line) is:
/Users/heckj/src/MeshGenerator/Sources/MeshGenerator/MeshGenerator.docc/Extensions/TextureCoordinates.md: warning: '_=(_:_:)-38jci' doesn't exist at '/MeshGenerator/TextureCoordinates'

This package exhibits several of these warnings, all apparently related to synthesized methods from default protocol conformance.
I've also verified this behavior exists on the current main branch of DocC (commit 2131c4358d9345cb72007dd53cca33ef410cf6b6).
Checklist

[X] If possible, I've reproduced the issue using the main branch of this package.
[X] This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior
No warnings displayed
Actual behavior
Warnings displayed, such as:
/Users/heckj/src/MeshGenerator/Sources/MeshGenerator/MeshGenerator.docc/Extensions/TextureCoordinates.md: warning: '_=(_:_:)-38jci' doesn't exist at '/MeshGenerator/TextureCoordinates'

When I've not added the symbol to any markdown (or more explicitly, I've replaced it)
Steps To Reproduce
Project: MeshGenerator

git clone https://github.com/heckj/MeshGenerator
cd MeshGenerator
git checkout 9912f61d3222a76364b156c6055be35fd48c348c

verify that the symbol isn't in use in code or markdown files:

grep -R "\_=(_:_:)-38jci" .

exhibit the errors

./docbuild.bash

or the more explicit version:

$(xcrun --find swift) package  generate-documentation  --target MeshGenerator

Swift-DocC Version Information
5.9.0
Swift Compiler Version Information
swift-driver version: 1.82.2 Apple Swift version 5.9 (swiftlang-5.9.0.114.10 clang-1500.0.29.1)
Target: arm64-apple-macosx13.0

Oh. this stumped me for a bit but now I see what's happening here. [overly specific implementation details to follow]
While crawling the curation to build up the documentation hierarchy, resolved links are updated to their absolute resolved topic reference versions. Before visiting the content of these pages these updated resolved topic reference strings are added to a lookup. I didn't think these links would be visited again before that but if the there's a second crawling pass there's a code path that visits them again before they're added to the lookup. That explains why these warnings don't have a source location. These links don't exist in the actual content, so there can't be a source range for them.
Thanks for reporting this.

authors: d-ronnqvist heckj

repo: apple/swift-docc


text:
Add i18n feature flag to ThemeSettings schema

Bug/issue #102139999, if applicable:
Summary
This PR adds i18n feature flag to ThemeSettings JSON schema
Dependencies
https://github.com/apple/swift-docc-render/pull/523

@swift-ci please test

@swift-ci please test

@swift-ci please test

@swift-ci please test

authors: ethan-kusters marinaaisa


text:
build: swap compiler search

Swap the toolchain search order.  This ensures that the correct linker setup is done on WIndows.  For some reason, the Swift search first will potentially pick up MinGW if the tools are in the path.

@swift-ci please test

@swift-ci please test

CC: @nkcsgexi

This is a horrible, terrible workaround for building on Windows when you have MinGW installed as well.

CC: @DougGregor @owenv

LGTM. What a strange fix to need

Interesting. Thank you for fixing this! @compnerd

authors: DougGregor compnerd nkcsgexi

repo: apple/swift-driver


text:
[5.7] Fix crash when emitting an atom of any

This is a cherry pick of https://github.com/apple/swift-experimental-string-processing/pull/546
Resolves: rdar://96280236

@swift-ci please test


text:
Close database and assert afterwards on the result.

rdar://55274300

@swift-ci please smoke test

@swift-ci please smoke test

@swift-ci please smoke test

@swift-ci please smoke test

@swift-ci please smoke test

repo: apple/swift-llbuild


text:
Add API ByteBuffer.clear(minimumCapacity:) (#1057)

Motivation:
This commit closes #1057.
The demand is a new API to ensure that the buffer has space for at least minimumCapacity after clearing the buffer.
In case the storage is not uniquely referenced, and the minimumCapacity is much smaller than the current capacity, this API can avoid allocating excessive memory.
Modifications:
Add a new API ByteBuffer.clear(minimumCapacity:)
Result:
More memory performant buffer clearing.

Hm, this appears to be a re-file of #1204. As I understand it you and @cweinberger worked on this together: do you two want to work out which of these should be preferred?

Oh, I was working on this with @kam800 and was not aware of #1204 .
I will talk with @cweinberger .

repo: apple/swift-nio


text:
[Build/PackageLoading] SR-13084: Improve user awareness for issues around missing resources

This addresses SR-13084.
In looking to use the new resources capability of SPM I faced some confusion when my setup wasn't working - it turned out to be that my paths were relative to the Package.swift rather than to the target. There was no warning/error and so wasn't the easiest to debug -- this MR aims to resolve this in two parts:

Currently the Bundle.module accessor is only created if at least one valid resource is generated in the bundle. A change in this MR means that the accessor is always created but is marked unavailable (with a user friendly message) if there are no valid resources.

A warning is raised as part of the package description diagnostics which lists the exact resources which were seen as missing. A warning has been chosen to act as a non-breaking change (though an error may be more appropriate)

The messages may need more finessing to make more sense - open to suggestions.
First attempt at trying to contribute to SPM so hopefully this isn't horrendous!
Thank you 🙌

@swift-ci please smoke test

Looks like there's a bug in the diagnostics work with paths to entire directories (not paths to an individual file). Will work on a fix 👍
Will get it all rebased too

authors: Sherlouk abertelrud

repo: apple/swift-package-manager


text:
Introduce the snippet target type

Snippets are small, focused pieces of example code for packages. They are meant
for current and potential package clients to read and try when exploring a
package.
Snippets build with the rest of a package so they don't get stale and
can run as an executable target with hidden "demo code" to illustrate and prove
that the snippets work (this does not mean that snippets are tests!).
Summary of changes:

Add a .snippet product and target type
Add the Snippet and SnippetGroup model to PackageModel
When building a package in PackageBuilder, look for snippets in the
Snippets subdirectory.
Add the "card stack" terminal UIs for browsing a package's snippets

"Top" card: The top level menu that displays products and snippet groups
"Snippet Group" card: The menu that shows the snippets in a group
"Snippet" card: Displays a snippet's presentation code and offers
to build and run the snippet.

[One line description of your change]
Motivation:
[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]
Modifications:
[Describe the modifications you've done.]
Result:
[After your change, what will change.]

@swift-ci please smoke test

authors: bitjammer neonichu


text:
remove String replace function

This function was't implemented and it is not used anywhere.
The project builds and all tests are passing.
Is it safe to delete some unused functions like these or could they be used in some other dependent projects?

Thanks!
It is safe to delete unused functions. We aren't currently trying to support downstream projects using the package manager internal libraries as dependencies. We will eventually have a public API, but that will probably only be one particular library for actually interacting with the package manager, not our support libraries.

authors: ddunbar kostiakoval


text:
Add swift test --no-parallel

This PR makes the --parallel flag on the swift-test subtool invertible with a "no" prefix.
We want swift-testing to default to enabling parallelization, but we don't want to break XCTest (which for historical reasons strongly prefers serial testing.) Deprecating --parallel and replacing it with --{enable,disable}-parallelism or similar seems a bit heavy-handed. Swift Argument Parser gives us the option to use a "no" prefix instead which means that the existing --parallel option will continue to work as intended.

@swift-ci please test


text:
Make sure the nesting level of sections in "Migrating from XCTest" is consistent.

This PR adjusts the header level of some of the sections of MigratingFromXCTest.md so that they are consistent. Namely, those sections that deal with converting specific "gadgets" within a test method/function are meant to be nested under the section about converting test methods/functions.

@swift-ci please test

repo: apple/swift-testing


text:
[AutoDiff] Incorrect tangent vector for generic function returning optional

Description
A differentiable generic function that returns an Optional yields an incorrect tangent vector.
Steps to reproduce
Place the following in a file:
import _Differentiation

@differentiable(reverse)
func givesWrongTangentVector<Element>(x: Element) -> Element? where Element: Differentiable {
    return x
}
@differentiable(reverse)
func f(x: Double) -> Double {
    let y = givesWrongTangentVector(x: x)
    return y!
}
@differentiable(reverse)
func g(x: Double) -> Double {
    return x
}
print(valueWithGradient(at: 0.0, of: f))
print(valueWithGradient(at: 0.0, of: g))

and build and run it.
Expected behavior
If the givesWrongTangentVector function was differentiable, you'd expect the results to be
(value: 0.0, gradient: 1.0)
(value: 0.0, gradient: 1.0)

but they instead are
(value: 0.0, gradient: 0.0)
(value: 0.0, gradient: 1.0)

However, it's unclear whether givesWrongTangentVector should be differentiable. A concrete version of the same function:
@differentiable(reverse)
func givesWrongTangentVector(x: Double) -> Double? {
    return x
}

is marked as not being differentiable by the compiler and won't build.
Environment

Swift compiler version info: all swift.org toolchains, this is not a recent regression

@asavonic Fixed by https://github.com/apple/swift/pull/68300?

@asl @asavonic Looks like it is indeed fixed by #68300, gradients are now correct in local testing.

authors: BradLarson asl

repo: apple/swift